< prev index next >

src/hotspot/share/runtime/objectMonitor.hpp

Print this page




  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_RUNTIME_OBJECTMONITOR_HPP
  26 #define SHARE_VM_RUNTIME_OBJECTMONITOR_HPP
  27 
  28 #include "memory/allocation.hpp"
  29 #include "memory/padded.hpp"
  30 #include "runtime/os.hpp"
  31 #include "runtime/park.hpp"
  32 #include "runtime/perfData.hpp"
  33 


  34 // ObjectWaiter serves as a "proxy" or surrogate thread.
  35 // TODO-FIXME: Eliminate ObjectWaiter and use the thread-specific
  36 // ParkEvent instead.  Beware, however, that the JVMTI code
  37 // knows about ObjectWaiters, so we'll have to reconcile that code.
  38 // See next_waiter(), first_waiter(), etc.
  39 
  40 class ObjectWaiter : public StackObj {
  41  public:
  42   enum TStates { TS_UNDEF, TS_READY, TS_RUN, TS_WAIT, TS_ENTER, TS_CXQ };
  43   enum Sorted  { PREPEND, APPEND, SORTED };
  44   ObjectWaiter * volatile _next;
  45   ObjectWaiter * volatile _prev;
  46   Thread*       _thread;
  47   jlong         _notifier_tid;
  48   ParkEvent *   _event;
  49   volatile int  _notified;
  50   volatile TStates TState;
  51   Sorted        _Sorted;           // List placement disposition
  52   bool          _active;           // Contention monitoring is enabled
  53  public:




  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_RUNTIME_OBJECTMONITOR_HPP
  26 #define SHARE_VM_RUNTIME_OBJECTMONITOR_HPP
  27 
  28 #include "memory/allocation.hpp"
  29 #include "memory/padded.hpp"
  30 #include "runtime/os.hpp"
  31 #include "runtime/park.hpp"
  32 #include "runtime/perfData.hpp"
  33 
  34 class ObjectMonitor;
  35 
  36 // ObjectWaiter serves as a "proxy" or surrogate thread.
  37 // TODO-FIXME: Eliminate ObjectWaiter and use the thread-specific
  38 // ParkEvent instead.  Beware, however, that the JVMTI code
  39 // knows about ObjectWaiters, so we'll have to reconcile that code.
  40 // See next_waiter(), first_waiter(), etc.
  41 
  42 class ObjectWaiter : public StackObj {
  43  public:
  44   enum TStates { TS_UNDEF, TS_READY, TS_RUN, TS_WAIT, TS_ENTER, TS_CXQ };
  45   enum Sorted  { PREPEND, APPEND, SORTED };
  46   ObjectWaiter * volatile _next;
  47   ObjectWaiter * volatile _prev;
  48   Thread*       _thread;
  49   jlong         _notifier_tid;
  50   ParkEvent *   _event;
  51   volatile int  _notified;
  52   volatile TStates TState;
  53   Sorted        _Sorted;           // List placement disposition
  54   bool          _active;           // Contention monitoring is enabled
  55  public:


< prev index next >