Mercurial > hg > truffle
diff src/os/linux/vm/os_linux.inline.hpp @ 9212:216dce75d5ac
Merge.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 08 Apr 2013 17:02:55 +0200 |
parents | 63e54c37ac64 |
children | f2110083203d |
line wrap: on
line diff
--- a/src/os/linux/vm/os_linux.inline.hpp Mon Apr 08 17:00:31 2013 +0200 +++ b/src/os/linux/vm/os_linux.inline.hpp Mon Apr 08 17:02:55 2013 +0200 @@ -25,7 +25,6 @@ #ifndef OS_LINUX_VM_OS_LINUX_INLINE_HPP #define OS_LINUX_VM_OS_LINUX_INLINE_HPP -#include "runtime/atomic.hpp" #include "runtime/atomic.inline.hpp" #include "runtime/os.hpp" @@ -288,4 +287,21 @@ const char* optval, socklen_t optlen) { return ::setsockopt(fd, level, optname, optval, optlen); } + +inline void os::Linux::SuspendResume::set_suspended() { + jint temp, temp2; + do { + temp = _state; + temp2 = Atomic::cmpxchg(temp | SR_SUSPENDED, &_state, temp); + } while (temp2 != temp); +} + +inline void os::Linux::SuspendResume::clear_suspended() { + jint temp, temp2; + do { + temp = _state; + temp2 = Atomic::cmpxchg(temp & ~SR_SUSPENDED, &_state, temp); + } while (temp2 != temp); +} + #endif // OS_LINUX_VM_OS_LINUX_INLINE_HPP