Index: build/make/components/vm/hythr.xml =================================================================== --- build/make/components/vm/hythr.xml (revision 423505) +++ build/make/components/vm/hythr.xml (working copy) @@ -27,7 +27,7 @@ - + @@ -62,7 +62,7 @@ + + Index: vm/vmcore/src/thread/hythr/hythr.def =================================================================== --- vm/vmcore/src/thread/hythr/hythr.def (revision 423505) +++ vm/vmcore/src/thread/hythr/hythr.def (working copy) @@ -1,21 +1,22 @@ LIBRARY HYTHR EXPORTS - hythread_monitor_init_with_name - hythread_monitor_destroy - hythread_monitor_try_enter - hythread_monitor_enter - hythread_monitor_notify_all - hythread_attach - hythread_create - hythread_detach - hythread_global - hythread_self - hythread_tls_alloc - hythread_tls_free - hythread_tls_set - - hythread_monitor_wait - hythread_monitor_exit - hythread_tls_get + hythread_attach + hythread_create + hythread_detach + hythread_exit + hythread_global + hythread_monitor_destroy + hythread_monitor_enter + hythread_monitor_exit + hythread_monitor_init_with_name + hythread_monitor_notify + hythread_monitor_notify_all + hythread_monitor_try_enter + hythread_monitor_wait + hythread_self + hythread_tls_alloc + hythread_tls_free + hythread_tls_get + hythread_tls_set Index: vm/vmcore/src/thread/hythr/hythr.exp =================================================================== --- vm/vmcore/src/thread/hythr/hythr.exp (revision 423505) +++ vm/vmcore/src/thread/hythr/hythr.exp (working copy) @@ -1,20 +1,22 @@ HYTHR_0.1 { - global : - hythread_monitor_init_with_name; - hythread_monitor_destroy; - hythread_monitor_try_enter; - hythread_monitor_enter; - hythread_monitor_notify_all; - hythread_attach; - hythread_create; - hythread_detach; - hythread_global; - hythread_self; - hythread_tls_alloc; - hythread_tls_free; - hythread_tls_set; - hythread_monitor_wait; - hythread_monitor_exit; - hythread_tls_get; - local : *; + global : + hythread_attach; + hythread_create; + hythread_detach; + hythread_exit; + hythread_global; + hythread_monitor_destroy; + hythread_monitor_enter; + hythread_monitor_exit; + hythread_monitor_init_with_name; + hythread_monitor_notify; + hythread_monitor_notify_all; + hythread_monitor_try_enter; + hythread_monitor_wait; + hythread_self; + hythread_tls_alloc; + hythread_tls_free; + hythread_tls_get; + hythread_tls_set; + local : *; }; Index: vm/vmcore/src/thread/hythr/hythreads.cpp =================================================================== --- vm/vmcore/src/thread/hythr/hythreads.cpp (revision 423505) +++ vm/vmcore/src/thread/hythr/hythreads.cpp (working copy) @@ -53,6 +53,7 @@ // Will do all initilalization of thread library. // init global_monitor now. JNIEXPORT void __cdecl hythread_init (void* lib) { + apr_initialize(); hythread_monitor_init_with_name(&p_global_monitor, 0, "Thread Global Monitor"); hythread_monitor_t *mon = (hythread_monitor_t*)hythread_global(GLOBAL_MONITOR_NAME); *mon = p_global_monitor; @@ -118,6 +119,12 @@ return 0; } JNIEXPORT int __cdecl +hythread_monitor_notify(hythread_monitor_t monitor){ + apr_status_t stat = apr_thread_cond_signal(monitor->cond); + RET_ON_ERROR(stat) + return 0; +} +JNIEXPORT int __cdecl hythread_monitor_notify_all (hythread_monitor_t monitor){ apr_status_t stat = apr_thread_cond_broadcast(monitor->cond); RET_ON_ERROR(stat) @@ -258,4 +265,26 @@ return 0; } + +JNIEXPORT int __cdecl +hythread_exit (hythread_monitor_t monitor) { + apr_status_t stat; + apr_os_thread_t aott; + apr_thread_t *att = NULL; + + // att = (apr_thread_t*)apr_pcalloc(get_pool(), sizeof(apr_thread_t*)); + aott = apr_os_thread_current(); + stat = apr_os_thread_put(&att, &aott, get_pool()); + RET_ON_ERROR(stat); + + if (monitor) { + hythread_monitor_exit(monitor); + } + + return apr_thread_exit(att, 0); +} + + + + }// extern "C" Index: vm/vmcore/src/thread/hythr/hythreads.h =================================================================== --- vm/vmcore/src/thread/hythr/hythreads.h (revision 423505) +++ vm/vmcore/src/thread/hythr/hythreads.h (working copy) @@ -51,6 +51,8 @@ JNIEXPORT int __cdecl hythread_monitor_exit (hythread_monitor_t monitor); JNIEXPORT int __cdecl +hythread_monitor_notify (hythread_monitor_t monitor); +JNIEXPORT int __cdecl hythread_monitor_notify_all (hythread_monitor_t monitor); JNIEXPORT int __cdecl hythread_monitor_wait (hythread_monitor_t monitor); @@ -63,6 +65,8 @@ JNIEXPORT void __cdecl hythread_detach (hythread_t handle); JNIEXPORT hythread_t __cdecl hythread_self(); +JNIEXPORT int __cdecl +hythread_exit (hythread_monitor_t monitor); JNIEXPORT unsigned* __cdecl hythread_global (char* name);