comparison src/share/vm/runtime/mutexLocker.hpp @ 14518:d8041d695d19

Merged with jdk9/dev/hotspot changeset 3812c088b945
author twisti
date Tue, 11 Mar 2014 18:45:59 -0700
parents cefad50507d8 8a9bb7821e28
children beea13269eab
comparison
equal deleted inserted replaced
14141:f97c5ec83832 14518:d8041d695d19
34 # include "os_solaris.inline.hpp" 34 # include "os_solaris.inline.hpp"
35 #endif 35 #endif
36 #ifdef TARGET_OS_FAMILY_windows 36 #ifdef TARGET_OS_FAMILY_windows
37 # include "os_windows.inline.hpp" 37 # include "os_windows.inline.hpp"
38 #endif 38 #endif
39 #ifdef TARGET_OS_FAMILY_aix
40 # include "os_aix.inline.hpp"
41 #endif
39 #ifdef TARGET_OS_FAMILY_bsd 42 #ifdef TARGET_OS_FAMILY_bsd
40 # include "os_bsd.inline.hpp" 43 # include "os_bsd.inline.hpp"
41 #endif 44 #endif
42 45
43 // Mutexes used in the VM. 46 // Mutexes used in the VM.
44 47
45 extern Mutex* Patching_lock; // a lock used to guard code patching of compiled code 48 extern Mutex* Patching_lock; // a lock used to guard code patching of compiled code
46 extern Monitor* SystemDictionary_lock; // a lock on the system dictonary 49 extern Monitor* SystemDictionary_lock; // a lock on the system dictionary
47 extern Mutex* PackageTable_lock; // a lock on the class loader package table 50 extern Mutex* PackageTable_lock; // a lock on the class loader package table
48 extern Mutex* CompiledIC_lock; // a lock used to guard compiled IC patching and access 51 extern Mutex* CompiledIC_lock; // a lock used to guard compiled IC patching and access
49 extern Mutex* InlineCacheBuffer_lock; // a lock used to guard the InlineCacheBuffer 52 extern Mutex* InlineCacheBuffer_lock; // a lock used to guard the InlineCacheBuffer
50 extern Mutex* VMStatistic_lock; // a lock used to guard statistics count increment 53 extern Mutex* VMStatistic_lock; // a lock used to guard statistics count increment
51 extern Mutex* JNIGlobalHandle_lock; // a lock on creating JNI global handles 54 extern Mutex* JNIGlobalHandle_lock; // a lock on creating JNI global handles
347 // 350 //
348 // A special MutexLocker that allows: 351 // A special MutexLocker that allows:
349 // - reentrant locking 352 // - reentrant locking
350 // - locking out of order 353 // - locking out of order
351 // 354 //
352 // Only too be used for verify code, where we can relaxe out dead-lock 355 // Only to be used for verify code, where we can relax out dead-lock
353 // dection code a bit (unsafe, but probably ok). This code is NEVER to 356 // detection code a bit (unsafe, but probably ok). This code is NEVER to
354 // be included in a product version. 357 // be included in a product version.
355 // 358 //
356 class VerifyMutexLocker: StackObj { 359 class VerifyMutexLocker: StackObj {
357 private: 360 private:
358 Monitor * _mutex; 361 Monitor * _mutex;
360 public: 363 public:
361 VerifyMutexLocker(Monitor * mutex) { 364 VerifyMutexLocker(Monitor * mutex) {
362 _mutex = mutex; 365 _mutex = mutex;
363 _reentrant = mutex->owned_by_self(); 366 _reentrant = mutex->owned_by_self();
364 if (!_reentrant) { 367 if (!_reentrant) {
365 // We temp. diable strict safepoint checking, while we require the lock 368 // We temp. disable strict safepoint checking, while we require the lock
366 FlagSetting fs(StrictSafepointChecks, false); 369 FlagSetting fs(StrictSafepointChecks, false);
367 _mutex->lock(); 370 _mutex->lock();
368 } 371 }
369 } 372 }
370 373