8313202: MutexLocker should disallow null Mutexes

Reviewed-by: dholmes, coleenp, dcubed
This commit is contained in:
Aleksey Shipilev 2023-09-13 07:32:54 +00:00
parent 36552e7193
commit 2d168c5734
18 changed files with 97 additions and 64 deletions

View file

@ -938,7 +938,7 @@ void ClassLoader::load_java_library() {
}
void ClassLoader::release_load_zip_library() {
MutexLocker locker(Zip_lock, Monitor::_no_safepoint_check_flag);
ConditionalMutexLocker locker(Zip_lock, Zip_lock != nullptr, Monitor::_no_safepoint_check_flag);
if (_libzip_loaded == 0) {
load_zip_library();
Atomic::release_store(&_libzip_loaded, 1);