Example #1
0
void dumpThreadStackTrace(Env* env, Thread* thread, CallStack* callStack) {
    // NOTE: This function must not be called concurrently. It uses global 
    // variables to transfer data to/from a signal handler.

    rvmAtomicStorePtr((void**) &dumpThreadStackTraceCallStack, callStack);
    if (pthread_kill(thread->pThread, DUMP_THREAD_STACK_TRACE_SIGNAL) != 0) {
        // The thread is probably not alive
        return;
    }

    while (sem_wait(&dumpThreadStackTraceCallSemaphore) == EINTR) {
    }
}
Example #2
0
void Java_sun_misc_Unsafe_putObjectVolatile(Env* env, Object* unsafe, Object* obj, jlong offset, Object* newValue) {
    if (!checkNull(env, obj)) return;
    Object** address = (Object**) getFieldAddress(obj, offset);
    rvmAtomicStorePtr((void**) address, newValue);
}