src/os/bsd/vm/os_bsd.inline.hpp
Print this page
rev 4205 : Fix non-PCH build on Linux, Windows and MacOS X
*** 23,33 ****
*/
#ifndef OS_BSD_VM_OS_BSD_INLINE_HPP
#define OS_BSD_VM_OS_BSD_INLINE_HPP
- #include "runtime/atomic.hpp"
#include "runtime/atomic.inline.hpp"
#include "runtime/os.hpp"
#ifdef TARGET_OS_ARCH_bsd_x86
# include "orderAccess_bsd_x86.inline.hpp"
--- 23,32 ----
*** 284,289 ****
--- 283,305 ----
inline int os::set_sock_opt(int fd, int level, int optname,
const char* optval, socklen_t optlen) {
return ::setsockopt(fd, level, optname, optval, optlen);
}
+
+ inline void os::Bsd::SuspendResume::set_suspended() {
+ jint temp, temp2;
+ do {
+ temp = _state;
+ temp2 = Atomic::cmpxchg(temp | SR_SUSPENDED, &_state, temp);
+ } while (temp2 != temp);
+ }
+
+ inline void os::Bsd::SuspendResume::clear_suspended() {
+ jint temp, temp2;
+ do {
+ temp = _state;
+ temp2 = Atomic::cmpxchg(temp & ~SR_SUSPENDED, &_state, temp);
+ } while (temp2 != temp);
+ }
+
#endif // OS_BSD_VM_OS_BSD_INLINE_HPP