File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 32
32
#include " VMHelpers.hpp"
33
33
#include " AtomicSupport.hpp"
34
34
#include " ObjectMonitor.hpp"
35
+ #include " VMAccess.hpp"
35
36
36
37
extern " C" {
37
38
@@ -172,14 +173,20 @@ objectMonitorEnterBlocking(J9VMThread *currentThread)
172
173
IDATA waitTime = 1 ;
173
174
if (J9_EVENT_IS_HOOKED (vm->hookInterface , J9HOOK_VM_MONITOR_CONTENDED_ENTER)) {
174
175
bool frameBuilt = saveBlockingEnterObject (currentThread);
176
+ VM_VMAccess::setPublicFlags (currentThread, J9_PUBLIC_FLAGS_THREAD_BLOCKED);
175
177
ALWAYS_TRIGGER_J9HOOK_VM_MONITOR_CONTENDED_ENTER (vm->hookInterface , currentThread, monitor);
176
178
restoreBlockingEnterObject (currentThread, frameBuilt);
177
179
}
178
180
omrthread_t const osThread = currentThread->osThread ;
179
181
/* Update j.l.management info */
180
182
currentThread->mgmtBlockedCount += 1 ;
183
+ if (J9_ARE_ALL_BITS_SET (currentThread->publicFlags , J9_PUBLIC_FLAGS_THREAD_BLOCKED)) {
184
+ internalReleaseVMAccess (currentThread);
185
+ goto releasedAccess;
186
+ }
181
187
restart:
182
188
internalReleaseVMAccessSetStatus (currentThread, J9_PUBLIC_FLAGS_THREAD_BLOCKED);
189
+ releasedAccess:
183
190
omrthread_monitor_enter_using_threadId (monitor, osThread);
184
191
#if defined(J9VM_THR_SMART_DEFLATION)
185
192
/* Update the anti-deflation vote because we had to block */
You can’t perform that action at this time.
0 commit comments