src/os/linux/vm/os_linux.inline.hpp

changeset 4675
63e54c37ac64
parent 4465
203f64878aab
child 5237
f2110083203d
     1.1 --- a/src/os/linux/vm/os_linux.inline.hpp	Fri Feb 22 10:16:51 2013 -0800
     1.2 +++ b/src/os/linux/vm/os_linux.inline.hpp	Wed Feb 27 09:40:30 2013 +0100
     1.3 @@ -25,7 +25,6 @@
     1.4  #ifndef OS_LINUX_VM_OS_LINUX_INLINE_HPP
     1.5  #define OS_LINUX_VM_OS_LINUX_INLINE_HPP
     1.6  
     1.7 -#include "runtime/atomic.hpp"
     1.8  #include "runtime/atomic.inline.hpp"
     1.9  #include "runtime/os.hpp"
    1.10  
    1.11 @@ -288,4 +287,21 @@
    1.12                              const char* optval, socklen_t optlen) {
    1.13    return ::setsockopt(fd, level, optname, optval, optlen);
    1.14  }
    1.15 +
    1.16 +inline void os::Linux::SuspendResume::set_suspended() {
    1.17 +  jint temp, temp2;
    1.18 +  do {
    1.19 +    temp = _state;
    1.20 +    temp2 = Atomic::cmpxchg(temp | SR_SUSPENDED, &_state, temp);
    1.21 +  } while (temp2 != temp);
    1.22 +}
    1.23 +
    1.24 +inline void os::Linux::SuspendResume::clear_suspended()        {
    1.25 +  jint temp, temp2;
    1.26 +  do {
    1.27 +    temp = _state;
    1.28 +    temp2 = Atomic::cmpxchg(temp & ~SR_SUSPENDED, &_state, temp);
    1.29 +  } while (temp2 != temp);
    1.30 +}
    1.31 +
    1.32  #endif // OS_LINUX_VM_OS_LINUX_INLINE_HPP

mercurial