NFIState
public final class NFIState- Inheritance
ObjectNFIState
Thread-local state of the NFI that is shared between different backends. All methods should only be called from the corresponding thread to which this state belongs (for thread-safety reasons and because the SVM NFI backend relies on it by using a FastThreadLocalBytes for the errno pointer, which means the errno pointer points inside the IsolateThread), except the constructor and dispose() which may be called from another thread, as Truffle hooks which call those are not guaranteed to be called from the corresponding thread.
Constructors1
Methods8
int getNFIErrno()No description.
void setNFIErrno(int)No description.
Throwable getPendingException()No description.
getPendingException
public Throwable getPendingException()No description.
Returns
Throwable- No description.
void setPendingException(Throwable)No description.
setPendingException
public void setPendingException(Throwable t)No description.
Parameters
tThrowable- No description.
void clearPendingException()No description.
Throwable savePendingException()
savePendingException
since 25.6public Throwable savePendingException()Saves and clears the pending exception so an upcall and its nested calls see a clean state. Pair this with restorePendingException(Throwable) in a finally block.
Returns
Throwable- the previous pending exception, or
null
void restorePendingException(Throwable)
restorePendingException
since 25.6public void restorePendingException(Throwable saved)Restores a non-null saved exception, replacing any exception produced by the upcall. If saved is null, leaves the current pending exception untouched so a new exception can propagate to the enclosing downcall.
Parameters
savedThrowable- the exception returned by
savePendingException()