Mercurial > hg > truffle
comparison src/share/vm/utilities/ostream.cpp @ 2263:5841dc1964f0
7021531: lock ordering problems after fix for 6354181
Reviewed-by: kvn, jrose
author | never |
---|---|
date | Tue, 22 Feb 2011 15:26:36 -0800 |
parents | d8a72fbc4be7 |
children | 29524004ce17 |
comparison
equal
deleted
inserted
replaced
2262:6bbaedb03534 | 2263:5841dc1964f0 |
---|---|
697 void ttyLocker::release_tty(intx holder) { | 697 void ttyLocker::release_tty(intx holder) { |
698 if (holder == defaultStream::NO_WRITER) return; | 698 if (holder == defaultStream::NO_WRITER) return; |
699 defaultStream::instance->release(holder); | 699 defaultStream::instance->release(holder); |
700 } | 700 } |
701 | 701 |
702 bool ttyLocker::release_tty_if_locked() { | |
703 intx thread_id = os::current_thread_id(); | |
704 if (defaultStream::instance->writer() == thread_id) { | |
705 // release the lock and return true so callers know if was | |
706 // previously held. | |
707 release_tty(thread_id); | |
708 return true; | |
709 } | |
710 return false; | |
711 } | |
712 | |
702 void ttyLocker::break_tty_lock_for_safepoint(intx holder) { | 713 void ttyLocker::break_tty_lock_for_safepoint(intx holder) { |
703 if (defaultStream::instance != NULL && | 714 if (defaultStream::instance != NULL && |
704 defaultStream::instance->writer() == holder) { | 715 defaultStream::instance->writer() == holder) { |
705 if (xtty != NULL) { | 716 if (xtty != NULL) { |
706 xtty->print_cr("<!-- safepoint while printing -->"); | 717 xtty->print_cr("<!-- safepoint while printing -->"); |