< prev index next >

src/hotspot/share/prims/jvmtiRawMonitor.cpp

Print this page
*** 121,10 ***
--- 121,13 ---
  // -------------------------------------------------------------------------
  
  void JvmtiRawMonitor::simple_enter(Thread* self) {
    for (;;) {
      if (Atomic::replace_if_null(&_owner, self)) {
+       if (self->is_Java_thread()) {
+         Continuation::pin(JavaThread::cast(self));
+       }
        return;
      }
  
      QNode node(self);
      self->_ParkEvent->reset();     // strictly optional

*** 135,10 ***
--- 138,13 ---
      _entry_list = &node;
      OrderAccess::fence();
      if (_owner == NULL && Atomic::replace_if_null(&_owner, self)) {
        _entry_list = node._next;
        RawMonitor_lock->unlock();
+       if (self->is_Java_thread()) {
+         Continuation::pin(JavaThread::cast(self));
+       }
        return;
      }
      RawMonitor_lock->unlock();
      while (node._t_state == QNode::TS_ENTER) {
        self->_ParkEvent->park();

*** 148,10 ***
--- 154,13 ---
  
  void JvmtiRawMonitor::simple_exit(Thread* self) {
    guarantee(_owner == self, "invariant");
    Atomic::release_store(&_owner, (Thread*)NULL);
    OrderAccess::fence();
+   if (self->is_Java_thread()) {
+     Continuation::unpin(JavaThread::cast(self));
+   }
    if (_entry_list == NULL) {
      return;
    }
  
    RawMonitor_lock->lock_without_safepoint_check();
< prev index next >