Search in sources :

Example 11 with TruffleSafepoint

use of com.oracle.truffle.api.TruffleSafepoint in project graal by oracle.

the class LLVMContext method finalizeContext.

void finalizeContext() {
    // join all created pthread - threads
    pThreadContext.joinAllThreads();
    TruffleSafepoint sp = TruffleSafepoint.getCurrent();
    boolean prev = sp.setAllowActions(false);
    try {
        cleanUpNoGuestCode();
    } finally {
        sp.setAllowActions(prev);
    }
}
Also used : TruffleSafepoint(com.oracle.truffle.api.TruffleSafepoint)

Aggregations

TruffleSafepoint (com.oracle.truffle.api.TruffleSafepoint)11 AbstractPolyglotTest (com.oracle.truffle.api.test.polyglot.AbstractPolyglotTest)5 Test (org.junit.Test)5 TruffleBoundary (com.oracle.truffle.api.CompilerDirectives.TruffleBoundary)4 ThreadLocalAction (com.oracle.truffle.api.ThreadLocalAction)4 ArrayList (java.util.ArrayList)4 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)4 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)4 Future (java.util.concurrent.Future)3 TruffleContext (com.oracle.truffle.api.TruffleContext)1 ProxyLanguage (com.oracle.truffle.api.test.polyglot.ProxyLanguage)1 LanguageContext (com.oracle.truffle.api.test.polyglot.ProxyLanguage.LanguageContext)1 UncaughtExceptionHandler (java.lang.Thread.UncaughtExceptionHandler)1 HashSet (java.util.HashSet)1 List (java.util.List)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 ExecutionException (java.util.concurrent.ExecutionException)1 Semaphore (java.util.concurrent.Semaphore)1 Condition (java.util.concurrent.locks.Condition)1 ReentrantLock (java.util.concurrent.locks.ReentrantLock)1