src/share/vm/runtime/mutex.hpp

changeset 490
2a8eb116ebbe
parent 435
a61af66fc99e
child 631
d1605aabd0a1
     1.1 --- a/src/share/vm/runtime/mutex.hpp	Thu Jan 31 14:56:50 2008 -0500
     1.2 +++ b/src/share/vm/runtime/mutex.hpp	Tue Feb 05 23:21:57 2008 -0800
     1.3 @@ -82,6 +82,9 @@
     1.4  // *in that order*.  If their implementations change such that these
     1.5  // assumptions are violated, a whole lot of code will break.
     1.6  
     1.7 +// The default length of monitor name is choosen to be 64 to avoid false sharing.
     1.8 +static const int MONITOR_NAME_LEN = 64;
     1.9 +
    1.10  class Monitor : public CHeapObj {
    1.11  
    1.12   public:
    1.13 @@ -126,9 +129,8 @@
    1.14    volatile intptr_t _WaitLock [1] ;      // Protects _WaitSet
    1.15    ParkEvent * volatile  _WaitSet ;       // LL of ParkEvents
    1.16    volatile bool     _snuck;              // Used for sneaky locking (evil).
    1.17 -  const char * _name;                    // Name of mutex
    1.18    int NotifyCount ;                      // diagnostic assist
    1.19 -  double pad [8] ;                       // avoid false sharing
    1.20 +  char _name[MONITOR_NAME_LEN];          // Name of mutex
    1.21  
    1.22    // Debugging fields for naming, deadlock detection, etc. (some only used in debug mode)
    1.23  #ifndef PRODUCT
    1.24 @@ -170,7 +172,7 @@
    1.25     int  ILocked () ;
    1.26  
    1.27   protected:
    1.28 -   static void ClearMonitor (Monitor * m) ;
    1.29 +   static void ClearMonitor (Monitor * m, const char* name = NULL) ;
    1.30     Monitor() ;
    1.31  
    1.32   public:

mercurial