@@ -164,7 +164,6 @@ objectMonitorEnterBlocking(J9VMThread *currentThread)
164
164
/* Table entry was created by the nonblocking case, so this peek cannot fail */
165
165
Assert_VM_notNull (objectMonitor);
166
166
object = NULL ; // for safety, since object may be moved by the GC at various points after this
167
- U_64 oldState = 0 ;
168
167
/* Ensure object monitor isn't deflated while we block */
169
168
omrthread_monitor_t monitor = objectMonitor->monitor ;
170
169
VM_AtomicSupport::add (&monitor->pinCount , 1 );
@@ -174,6 +173,8 @@ objectMonitorEnterBlocking(J9VMThread *currentThread)
174
173
IDATA waitTime = 1 ;
175
174
if (J9_EVENT_IS_HOOKED (vm->hookInterface , J9HOOK_VM_MONITOR_CONTENDED_ENTER)) {
176
175
bool frameBuilt = saveBlockingEnterObject (currentThread);
176
+ /* Set j.l.Thread status to BLOCKED. */
177
+ VM_VMHelpers::setThreadState (currentThread, J9VMTHREAD_STATE_BLOCKED);
177
178
VM_VMAccess::setPublicFlags (currentThread, J9_PUBLIC_FLAGS_THREAD_BLOCKED);
178
179
ALWAYS_TRIGGER_J9HOOK_VM_MONITOR_CONTENDED_ENTER (vm->hookInterface , currentThread, monitor);
179
180
restoreBlockingEnterObject (currentThread, frameBuilt);
@@ -187,7 +188,7 @@ objectMonitorEnterBlocking(J9VMThread *currentThread)
187
188
}
188
189
restart:
189
190
/* Set j.l.Thread status to BLOCKED. */
190
- oldState = VM_VMHelpers::setThreadState (currentThread, J9VMTHREAD_STATE_BLOCKED);
191
+ VM_VMHelpers::setThreadState (currentThread, J9VMTHREAD_STATE_BLOCKED);
191
192
internalReleaseVMAccessSetStatus (currentThread, J9_PUBLIC_FLAGS_THREAD_BLOCKED);
192
193
releasedAccess:
193
194
omrthread_monitor_enter_using_threadId (monitor, osThread);
@@ -288,8 +289,8 @@ objectMonitorEnterBlocking(J9VMThread *currentThread)
288
289
}
289
290
done:
290
291
clearEventFlag (currentThread, J9_PUBLIC_FLAGS_THREAD_BLOCKED);
291
- /* Set j.l.Thread status to oldState . */
292
- VM_VMHelpers::setThreadState (currentThread, oldState );
292
+ /* Set j.l.Thread status to RUNNING state . */
293
+ VM_VMHelpers::setThreadState (currentThread, J9VMTHREAD_STATE_RUNNING );
293
294
294
295
/* Clear the SUPPRESS_CONTENDED_EXITS bit in the monitor saying that CONTENDED EXIT can be sent again */
295
296
((J9ThreadMonitor*)monitor)->flags &= ~(UDATA)J9THREAD_MONITOR_SUPPRESS_CONTENDED_EXIT;
0 commit comments