Index: vm/include/open/hythread_ext.h =================================================================== --- vm/include/open/hythread_ext.h (revision 598956) +++ vm/include/open/hythread_ext.h (working copy) @@ -134,6 +134,7 @@ #include #include "apr_thread_ext.h" +#include "apr_atomic.h" //@{ /** @@ -637,6 +638,7 @@ hy_inline void VMCALL hythread_suspend_disable() { register hythread_t thread; + uint32 dummy_lock; //used as the target of a lock inc // Check that current thread is in default thread group. // Justification: GC suspends and enumerates threads from @@ -647,6 +649,9 @@ ((HyThread_public *)thread)->disable_count++; //apr_memory_rw_barrier(); + if (thread->request) { //wjw + apr_atomic_inc32(&dummy_lock); //we don't care what happens to dummy_lock location. We just want to cause a store buffer flush + } if (((HyThread_public *)thread)->request && ((HyThread_public *)thread)->disable_count == 1) { Index: vm/thread/src/thread_native_suspend.c =================================================================== --- vm/thread/src/thread_native_suspend.c (revision 598956) +++ vm/thread/src/thread_native_suspend.c (working copy) @@ -157,6 +157,11 @@ // increment suspend count apr_atomic_inc32(&thread->suspend_count); apr_atomic_inc32(&thread->request); + // wjw + // the below yield should cause the target thread to run before returning from + // send_suspend_request(). The concept is to force the target thread out of race windows + apr_thread_yield(); + apr_thread_yield(); } /**