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
|
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 NONCOPYABLE(PlatformMutex);
194
195 protected:
196 CRITICAL_SECTION _mutex; // Native mutex for locking
197
198 public:
199 PlatformMutex();
200 ~PlatformMutex();
201 void lock();
202 void unlock();
203 bool try_lock();
204 };
205
206 class PlatformMonitor : public PlatformMutex {
207 private:
208 CONDITION_VARIABLE _cond; // Native condition variable for blocking
209 NONCOPYABLE(PlatformMonitor);
210
211 public:
212 PlatformMonitor();
213 ~PlatformMonitor();
214 int wait(jlong millis);
215 void notify();
216 void notify_all();
217 };
218
219 #endif // OS_WINDOWS_OS_WINDOWS_HPP
|