Skip to content

Commit

Permalink
Check the return value before setting the flag for SCC read mutex
Browse files Browse the repository at this point in the history
Fixes eclipse-openj9#9997

Signed-off-by: Hang Shao <[email protected]>
  • Loading branch information
hangshao0 committed Jun 29, 2020
1 parent 67ff58c commit e20f374
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions runtime/shared_common/CompositeCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2470,12 +2470,13 @@ SH_CompositeCacheImpl::enterReadMutex(J9VMThread* currentThread, const char* cal
if (rc != 0) {
PORT_ACCESS_FROM_PORT(_portlib);
CC_ERR_TRACE1(J9NLS_SHRC_CC_FAILED_EXIT_MUTEX, rc);
decReaderCount(currentThread);
}
}
}

currentThread->privateFlags2 |= J9_PRIVATE_FLAGS2_IN_SHARED_CACHE_READ_MUTEX;

if (0 == rc) {
currentThread->privateFlags2 |= J9_PRIVATE_FLAGS2_IN_SHARED_CACHE_READ_MUTEX;
}
Trc_SHR_CC_enterReadMutex_Exit(currentThread, caller, rc);
return rc;
}
Expand Down

0 comments on commit e20f374

Please sign in to comment.