Mercurial > hg > truffle
comparison src/share/vm/runtime/mutex.hpp @ 14518:d8041d695d19
Merged with jdk9/dev/hotspot changeset 3812c088b945
author | twisti |
---|---|
date | Tue, 11 Mar 2014 18:45:59 -0700 |
parents | 63a4eb8bcd23 |
children | 4ca6dc0799b6 |
comparison
equal
deleted
inserted
replaced
14141:f97c5ec83832 | 14518:d8041d695d19 |
---|---|
88 | 88 |
89 public: | 89 public: |
90 // A special lock: Is a lock where you are guaranteed not to block while you are | 90 // A special lock: Is a lock where you are guaranteed not to block while you are |
91 // holding it, i.e., no vm operation can happen, taking other locks, etc. | 91 // holding it, i.e., no vm operation can happen, taking other locks, etc. |
92 // NOTE: It is critical that the rank 'special' be the lowest (earliest) | 92 // NOTE: It is critical that the rank 'special' be the lowest (earliest) |
93 // (except for "event"?) for the deadlock dection to work correctly. | 93 // (except for "event"?) for the deadlock detection to work correctly. |
94 // The rank native is only for use in Mutex's created by JVM_RawMonitorCreate, | 94 // The rank native is only for use in Mutex's created by JVM_RawMonitorCreate, |
95 // which being external to the VM are not subject to deadlock detection. | 95 // which being external to the VM are not subject to deadlock detection. |
96 // The rank safepoint is used only for synchronization in reaching a | 96 // The rank safepoint is used only for synchronization in reaching a |
97 // safepoint and leaving a safepoint. It is only used for the Safepoint_lock | 97 // safepoint and leaving a safepoint. It is only used for the Safepoint_lock |
98 // currently. While at a safepoint no mutexes of rank safepoint are held | 98 // currently. While at a safepoint no mutexes of rank safepoint are held |
239 // constructed from pthreads primitives might extend a mutex by adding | 239 // constructed from pthreads primitives might extend a mutex by adding |
240 // a condvar and some extra metadata. In fact this was the case until J2SE7. | 240 // a condvar and some extra metadata. In fact this was the case until J2SE7. |
241 // | 241 // |
242 // Currently, however, the base object is a monitor. Monitor contains all the | 242 // Currently, however, the base object is a monitor. Monitor contains all the |
243 // logic for wait(), notify(), etc. Mutex extends monitor and restricts the | 243 // logic for wait(), notify(), etc. Mutex extends monitor and restricts the |
244 // visiblity of wait(), notify(), and notify_all(). | 244 // visibility of wait(), notify(), and notify_all(). |
245 // | 245 // |
246 // Another viable alternative would have been to have Monitor extend Mutex and | 246 // Another viable alternative would have been to have Monitor extend Mutex and |
247 // implement all the normal mutex and wait()-notify() logic in Mutex base class. | 247 // implement all the normal mutex and wait()-notify() logic in Mutex base class. |
248 // The wait()-notify() facility would be exposed via special protected member functions | 248 // The wait()-notify() facility would be exposed via special protected member functions |
249 // (e.g., _Wait() and _Notify()) in Mutex. Monitor would extend Mutex and expose wait() | 249 // (e.g., _Wait() and _Notify()) in Mutex. Monitor would extend Mutex and expose wait() |