src/hotspot/os/solaris/os_solaris.hpp
changeset 57738 807d192fb7dd
parent 53849 46ef4dea49e5
child 58654 562bf1878089
equal deleted inserted replaced
57737:6bbb4af131e3 57738:807d192fb7dd
   333     status = os::Solaris::mutex_init(_mutex);
   333     status = os::Solaris::mutex_init(_mutex);
   334     assert_status(status == 0, status, "mutex_init");
   334     assert_status(status == 0, status, "mutex_init");
   335   }
   335   }
   336 };
   336 };
   337 
   337 
   338 // Platform specific implementation that underpins VM Monitor/Mutex class
   338 // Platform specific implementations that underpin VM Mutex/Monitor classes
   339 class PlatformMonitor : public CHeapObj<mtSynchronizer> {
   339 
   340  private:
   340 class PlatformMutex : public CHeapObj<mtSynchronizer> {
       
   341   // Disable copying
       
   342   PlatformMutex(const PlatformMutex&);
       
   343   PlatformMutex& operator=(const PlatformMutex&);
       
   344 
       
   345  protected:
   341   mutex_t _mutex; // Native mutex for locking
   346   mutex_t _mutex; // Native mutex for locking
   342   cond_t  _cond;  // Native condition variable for blocking
   347 
   343 
   348  public:
   344  public:
   349   PlatformMutex();
   345   PlatformMonitor();
   350   ~PlatformMutex();
   346   ~PlatformMonitor();
       
   347   void lock();
   351   void lock();
   348   void unlock();
   352   void unlock();
   349   bool try_lock();
   353   bool try_lock();
       
   354 };
       
   355 
       
   356 class PlatformMonitor : public PlatformMutex {
       
   357  private:
       
   358   cond_t  _cond;  // Native condition variable for blocking
       
   359   // Disable copying
       
   360   PlatformMonitor(const PlatformMonitor&);
       
   361   PlatformMonitor& operator=(const PlatformMonitor&);
       
   362 
       
   363  public:
       
   364   PlatformMonitor();
       
   365   ~PlatformMonitor();
   350   int wait(jlong millis);
   366   int wait(jlong millis);
   351   void notify();
   367   void notify();
   352   void notify_all();
   368   void notify_all();
   353 };
   369 };
   354 
   370