Mercurial > hg > truffle
comparison src/share/vm/memory/gcLocker.cpp @ 142:8bd1e4487c18
Merge
author | iveresov |
---|---|
date | Sun, 04 May 2008 03:29:31 -0700 |
parents | c0492d52d55b |
children | d1605aabd0a1 |
comparison
equal
deleted
inserted
replaced
138:bcdc68eb7e1f | 142:8bd1e4487c18 |
---|---|
30 volatile bool GC_locker::_needs_gc = false; | 30 volatile bool GC_locker::_needs_gc = false; |
31 volatile bool GC_locker::_doing_gc = false; | 31 volatile bool GC_locker::_doing_gc = false; |
32 | 32 |
33 void GC_locker::stall_until_clear() { | 33 void GC_locker::stall_until_clear() { |
34 assert(!JavaThread::current()->in_critical(), "Would deadlock"); | 34 assert(!JavaThread::current()->in_critical(), "Would deadlock"); |
35 if (PrintJNIGCStalls && PrintGCDetails) { | |
36 ResourceMark rm; // JavaThread::name() allocates to convert to UTF8 | |
37 gclog_or_tty->print_cr( | |
38 "Allocation failed. Thread \"%s\" is stalled by JNI critical section.", | |
39 JavaThread::current()->name()); | |
40 } | |
35 MutexLocker ml(JNICritical_lock); | 41 MutexLocker ml(JNICritical_lock); |
36 // Wait for _needs_gc to be cleared | 42 // Wait for _needs_gc to be cleared |
37 while (GC_locker::needs_gc()) { | 43 while (GC_locker::needs_gc()) { |
38 JNICritical_lock->wait(); | 44 JNICritical_lock->wait(); |
39 } | 45 } |