hotspot/src/share/vm/utilities/ostream.cpp
changeset 8333 11a7f6fc6419
parent 8114 340b5b8b544b
child 8867 6febcc945802
equal deleted inserted replaced
8332:3320859e937a 8333:11a7f6fc6419
   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 -->");