45 |
* Signature: (J)V |
* Signature: (J)V |
46 |
* |
* |
47 |
* Purpose: Run the C function whose function pointer is |
* Purpose: Run the C function whose function pointer is |
48 |
* |
* |
49 |
*/ |
*/ |
50 |
JNIEXPORT void JNICALL |
JNIEXPORT void JNICALL |
51 |
Java_gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_nativeRun(JNIEnv *gdk_env, jobject lcl_obj, |
Java_gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_nativeRun(JNIEnv *gdk_env __attribute__((unused)), jobject lcl_obj __attribute__((unused)), jlong funcAddr, jlong funcArg) |
|
jlong funcAddr, jlong funcArg) |
|
52 |
{ |
{ |
53 |
/* Convert the function's address back into a pointer to a C function. */ |
/* Convert the function's address back into a pointer to a C function. */ |
54 |
void *(*funcPtr)(void *) = (void *(*)(void *)) funcAddr; |
void *(*funcPtr)(void *) = (void *(*)(void *)) (size_t)funcAddr; |
55 |
|
|
56 |
/* We do not need to worry about the return value from funcPtr(); it's |
/* We do not need to worry about the return value from funcPtr(); it's |
57 |
just thrown away. That is part of the g_threads spec, so no reason |
just thrown away. That is part of the g_threads spec, so no reason |
58 |
to worry about returning it. */ |
to worry about returning it. */ |
59 |
(void) funcPtr((void *) funcArg); |
(void) funcPtr((void *) (size_t)funcArg); |
60 |
/* Fall off the end and terminate the thread of control. */ |
/* Fall off the end and terminate the thread of control. */ |
61 |
} |
} |
62 |
|
|