< prev index next >

src/hotspot/os/windows/os_windows.hpp

Print this page




 170     void park () ;
 171     void unpark () ;
 172     int  park (jlong millis) ;
 173 } ;
 174 
 175 
 176 
 177 class PlatformParker : public CHeapObj<mtSynchronizer> {
 178   protected:
 179     HANDLE _ParkEvent ;
 180 
 181   public:
 182     ~PlatformParker () { guarantee (0, "invariant") ; }
 183     PlatformParker  () {
 184       _ParkEvent = CreateEvent (NULL, true, false, NULL) ;
 185       guarantee (_ParkEvent != NULL, "invariant") ;
 186     }
 187 
 188 } ;
 189 
 190 // Platform specific implementations that underpin VM Mutex/Monitor classes
 191 
 192 class PlatformMutex : public CHeapObj<mtSynchronizer> {
 193   // Disable copying
 194   PlatformMutex(const PlatformMutex&);
 195   PlatformMutex& operator=(const PlatformMutex&);
 196 
 197  protected:
 198   CRITICAL_SECTION   _mutex; // Native mutex for locking
 199 
 200  public:
 201   PlatformMutex();
 202   ~PlatformMutex();
 203   void lock();
 204   void unlock();
 205   bool try_lock();
 206 };
 207 
 208 class PlatformMonitor : public PlatformMutex {
 209  private:

 210   CONDITION_VARIABLE _cond;  // Native condition variable for blocking
 211   // Disable copying
 212   PlatformMonitor(const PlatformMonitor&);
 213   PlatformMonitor& operator=(const PlatformMonitor&);
 214 
 215  public:
 216   PlatformMonitor();
 217   ~PlatformMonitor();



 218   int wait(jlong millis);
 219   void notify();
 220   void notify_all();
 221 };
 222 
 223 #endif // OS_WINDOWS_OS_WINDOWS_HPP


 170     void park () ;
 171     void unpark () ;
 172     int  park (jlong millis) ;
 173 } ;
 174 
 175 
 176 
 177 class PlatformParker : public CHeapObj<mtSynchronizer> {
 178   protected:
 179     HANDLE _ParkEvent ;
 180 
 181   public:
 182     ~PlatformParker () { guarantee (0, "invariant") ; }
 183     PlatformParker  () {
 184       _ParkEvent = CreateEvent (NULL, true, false, NULL) ;
 185       guarantee (_ParkEvent != NULL, "invariant") ;
 186     }
 187 
 188 } ;
 189 
 190 // Platform specific implementation that underpins VM Monitor/Mutex class
 191 class PlatformMonitor : public CHeapObj<mtSynchronizer> {

















 192  private:
 193   CRITICAL_SECTION   _mutex; // Native mutex for locking
 194   CONDITION_VARIABLE _cond;  // Native condition variable for blocking



 195 
 196  public:
 197   PlatformMonitor();
 198   ~PlatformMonitor();
 199   void lock();
 200   void unlock();
 201   bool try_lock();
 202   int wait(jlong millis);
 203   void notify();
 204   void notify_all();
 205 };
 206 
 207 #endif // OS_WINDOWS_OS_WINDOWS_HPP
< prev index next >