コード例 #1
0
ファイル: tagger.cpp プロジェクト: ansalond/bytecode-examples
/*
 * Callback we get when the JVM is initialized. We use this time to setup our GC thread
 */
static void JNICALL callbackVMInit(jvmtiEnv * jvmti, JNIEnv * env, jthread thread)
{
	jvmtiError err;

	err = jvmti->RunAgentThread(alloc_thread(env), &gcWorker, NULL,
			JVMTI_THREAD_MAX_PRIORITY);
	check_jvmti_error(jvmti, err, "Unable to run agent cleanup thread");
}
コード例 #2
0
ファイル: thread.c プロジェクト: ConstNW/neko
/**
	thread_current : void -> 'thread
	<doc>Returns the current thread</doc>
**/
static value thread_current() {
	vthread *t = neko_thread_current();
	// should only occur for main thread !
	if( t == NULL ) {
		neko_vm *vm = neko_vm_current();
		t = alloc_thread(vm);
		neko_vm_set_custom(vm,k_thread,t);
	}
	return t->v;
}
コード例 #3
0
ファイル: thread.c プロジェクト: ConstNW/neko
static void thread_init( void *_p ) {
	tparams *p = (tparams*)_p;
	neko_vm *vm;
	// init the VM and set current thread
	vm = neko_vm_alloc(NULL);
	p->t = alloc_thread(vm);
	neko_vm_jit(vm,p->jit);
	neko_vm_select(vm);
	neko_vm_set_custom(vm,k_thread,p->t);
}
コード例 #4
0
ファイル: gctest.c プロジェクト: AntinZhu/jdk-source
/* Callback for JVMTI_EVENT_VM_INIT */
static void JNICALL
vm_init(jvmtiEnv *jvmti, JNIEnv *env, jthread thread)
{
    jvmtiError err;

    stdout_message("VMInit...\n");

    err = (*jvmti)->RunAgentThread(jvmti, alloc_thread(env), &worker, NULL,
        JVMTI_THREAD_MAX_PRIORITY);
    check_jvmti_error(jvmti, err, "running agent thread");
}
コード例 #5
0
ファイル: main.cpp プロジェクト: mainboy/alma
/* Callback for JVMTI_EVENT_VM_INIT */
static void JNICALL 
vm_init(jvmtiEnv *jvmti, JNIEnv *env, jthread thread)
{
    jvmtiError err;
    
    fprintf(log, "VMInit...\n");

    err = jvmti->RunAgentThread(alloc_thread(env), &worker2, NULL,
	JVMTI_THREAD_MAX_PRIORITY);
    if (err != JVMTI_ERROR_NONE) {
	fprintf(log, "ERROR: RunAgentProc failed (worker2), err=%d\n", err);
    }
}
コード例 #6
0
ファイル: thread.c プロジェクト: forthewatch/xdm
struct thread *create_thread(thread_fun function, void *data)
{
	struct thread *thr;

	thr = alloc_thread();
	if(thr == NULL) {
		return NULL;
	}

	thr->function = function;
	thr->data = data;

	return thr;
}