< prev index next >

src/hotspot/os/solaris/os_solaris.hpp

Print this page
rev 57095 : [mq]: use
rev 57096 : [mq]: trailing_semi


 317  protected:
 318   mutex_t _mutex[1];
 319   cond_t  _cond[1];
 320 
 321  public:       // TODO-FIXME: make dtor private
 322   ~PlatformParker() { guarantee(0, "invariant"); }
 323 
 324  public:
 325   PlatformParker() {
 326     int status;
 327     status = os::Solaris::cond_init(_cond);
 328     assert_status(status == 0, status, "cond_init");
 329     status = os::Solaris::mutex_init(_mutex);
 330     assert_status(status == 0, status, "mutex_init");
 331   }
 332 };
 333 
 334 // Platform specific implementations that underpin VM Mutex/Monitor classes
 335 
 336 class PlatformMutex : public CHeapObj<mtSynchronizer> {
 337   // Disable copying
 338   PlatformMutex(const PlatformMutex&);
 339   PlatformMutex& operator=(const PlatformMutex&);
 340 
 341  protected:
 342   mutex_t _mutex; // Native mutex for locking
 343 
 344  public:
 345   PlatformMutex();
 346   ~PlatformMutex();
 347   void lock();
 348   void unlock();
 349   bool try_lock();
 350 };
 351 
 352 class PlatformMonitor : public PlatformMutex {
 353  private:
 354   cond_t  _cond;  // Native condition variable for blocking
 355   // Disable copying
 356   PlatformMonitor(const PlatformMonitor&);
 357   PlatformMonitor& operator=(const PlatformMonitor&);
 358 
 359  public:
 360   PlatformMonitor();
 361   ~PlatformMonitor();
 362   int wait(jlong millis);
 363   void notify();
 364   void notify_all();
 365 };
 366 
 367 #endif // OS_SOLARIS_OS_SOLARIS_HPP


 317  protected:
 318   mutex_t _mutex[1];
 319   cond_t  _cond[1];
 320 
 321  public:       // TODO-FIXME: make dtor private
 322   ~PlatformParker() { guarantee(0, "invariant"); }
 323 
 324  public:
 325   PlatformParker() {
 326     int status;
 327     status = os::Solaris::cond_init(_cond);
 328     assert_status(status == 0, status, "cond_init");
 329     status = os::Solaris::mutex_init(_mutex);
 330     assert_status(status == 0, status, "mutex_init");
 331   }
 332 };
 333 
 334 // Platform specific implementations that underpin VM Mutex/Monitor classes
 335 
 336 class PlatformMutex : public CHeapObj<mtSynchronizer> {
 337   NONCOPYABLE(PlatformMutex);


 338 
 339  protected:
 340   mutex_t _mutex; // Native mutex for locking
 341 
 342  public:
 343   PlatformMutex();
 344   ~PlatformMutex();
 345   void lock();
 346   void unlock();
 347   bool try_lock();
 348 };
 349 
 350 class PlatformMonitor : public PlatformMutex {
 351  private:
 352   cond_t  _cond;  // Native condition variable for blocking
 353 
 354   NONCOPYABLE(PlatformMonitor);

 355 
 356  public:
 357   PlatformMonitor();
 358   ~PlatformMonitor();
 359   int wait(jlong millis);
 360   void notify();
 361   void notify_all();
 362 };
 363 
 364 #endif // OS_SOLARIS_OS_SOLARIS_HPP
< prev index next >