1.1 --- a/src/share/vm/prims/jni.cpp Thu Jan 08 16:27:28 2009 -0500 1.2 +++ b/src/share/vm/prims/jni.cpp Tue Jan 13 12:08:43 2009 -0800 1.3 @@ -2691,8 +2691,13 @@ 1.4 1.5 directBufferSupportInitializeEnded = 1; 1.6 } else { 1.7 - ThreadInVMfromNative tivn(thread); // set state as yield_all can call os:sleep 1.8 while (!directBufferSupportInitializeEnded && !directBufferSupportInitializeFailed) { 1.9 + // Set state as yield_all can call os:sleep. On Solaris, yield_all calls 1.10 + // os::sleep which requires the VM state transition. On other platforms, it 1.11 + // is not necessary. The following call to change the VM state is purposely 1.12 + // put inside the loop to avoid potential deadlock when multiple threads 1.13 + // try to call this method. See 6791815 for more details. 1.14 + ThreadInVMfromNative tivn(thread); 1.15 os::yield_all(); 1.16 } 1.17 }