equal
deleted
inserted
replaced
35 # include "semaphore_windows.hpp" |
35 # include "semaphore_windows.hpp" |
36 #else |
36 #else |
37 # error "No semaphore implementation provided for this OS" |
37 # error "No semaphore implementation provided for this OS" |
38 #endif |
38 #endif |
39 |
39 |
|
40 class JavaThread; |
|
41 |
40 // Implements the limited, platform independent Semaphore API. |
42 // Implements the limited, platform independent Semaphore API. |
41 class Semaphore : public CHeapObj<mtInternal> { |
43 class Semaphore : public CHeapObj<mtInternal> { |
42 SemaphoreImpl _impl; |
44 SemaphoreImpl _impl; |
43 |
45 |
44 // Prevent copying and assignment of Semaphore instances. |
46 // Prevent copying and assignment of Semaphore instances. |
52 void signal(uint count = 1) { _impl.signal(count); } |
54 void signal(uint count = 1) { _impl.signal(count); } |
53 |
55 |
54 void wait() { _impl.wait(); } |
56 void wait() { _impl.wait(); } |
55 |
57 |
56 bool trywait() { return _impl.trywait(); } |
58 bool trywait() { return _impl.trywait(); } |
|
59 |
|
60 void wait_with_safepoint_check(); |
|
61 void wait_with_safepoint_check(JavaThread* thread); |
57 }; |
62 }; |
58 |
63 |
59 |
|
60 #endif // SHARE_VM_RUNTIME_SEMAPHORE_HPP |
64 #endif // SHARE_VM_RUNTIME_SEMAPHORE_HPP |