Mercurial > hg > graal-compiler
comparison src/share/vm/memory/collectorPolicy.cpp @ 6923:3fadc0e8cffe
8000988: VM deadlock when running btree006 on windows-i586
Reviewed-by: johnc, jcoomes, ysr
author | jmasa |
---|---|
date | Tue, 30 Oct 2012 10:23:55 -0700 |
parents | 8da5e203b993 |
children | f34d701e952e |
comparison
equal
deleted
inserted
replaced
6915:a516debe2cee | 6923:3fadc0e8cffe |
---|---|
740 Metaspace::MetadataType mdtype) { | 740 Metaspace::MetadataType mdtype) { |
741 uint loop_count = 0; | 741 uint loop_count = 0; |
742 uint gc_count = 0; | 742 uint gc_count = 0; |
743 uint full_gc_count = 0; | 743 uint full_gc_count = 0; |
744 | 744 |
745 assert(!Heap_lock->owned_by_self(), "Should not be holding the Heap_lock"); | |
746 | |
745 do { | 747 do { |
746 MetaWord* result = NULL; | 748 MetaWord* result = NULL; |
747 if (GC_locker::is_active_and_needs_gc()) { | 749 if (GC_locker::is_active_and_needs_gc()) { |
748 // If the GC_locker is active, just expand and allocate. | 750 // If the GC_locker is active, just expand and allocate. |
749 // If that does not succeed, wait if this thread is not | 751 // If that does not succeed, wait if this thread is not |
754 if (result != NULL) { | 756 if (result != NULL) { |
755 return result; | 757 return result; |
756 } | 758 } |
757 JavaThread* jthr = JavaThread::current(); | 759 JavaThread* jthr = JavaThread::current(); |
758 if (!jthr->in_critical()) { | 760 if (!jthr->in_critical()) { |
759 MutexUnlocker mul(Heap_lock); | |
760 // Wait for JNI critical section to be exited | 761 // Wait for JNI critical section to be exited |
761 GC_locker::stall_until_clear(); | 762 GC_locker::stall_until_clear(); |
762 // The GC invoked by the last thread leaving the critical | 763 // The GC invoked by the last thread leaving the critical |
763 // section will be a young collection and a full collection | 764 // section will be a young collection and a full collection |
764 // is (currently) needed for unloading classes so continue | 765 // is (currently) needed for unloading classes so continue |