equal
deleted
inserted
replaced
35 inline void Thread::set_suspend_flag(SuspendFlags f) { |
35 inline void Thread::set_suspend_flag(SuspendFlags f) { |
36 uint32_t flags; |
36 uint32_t flags; |
37 do { |
37 do { |
38 flags = _suspend_flags; |
38 flags = _suspend_flags; |
39 } |
39 } |
40 while (Atomic::cmpxchg((flags | f), &_suspend_flags, flags) != flags); |
40 while (Atomic::cmpxchg(&_suspend_flags, flags, (flags | f)) != flags); |
41 } |
41 } |
42 inline void Thread::clear_suspend_flag(SuspendFlags f) { |
42 inline void Thread::clear_suspend_flag(SuspendFlags f) { |
43 uint32_t flags; |
43 uint32_t flags; |
44 do { |
44 do { |
45 flags = _suspend_flags; |
45 flags = _suspend_flags; |
46 } |
46 } |
47 while (Atomic::cmpxchg((flags & ~f), &_suspend_flags, flags) != flags); |
47 while (Atomic::cmpxchg(&_suspend_flags, flags, (flags & ~f)) != flags); |
48 } |
48 } |
49 |
49 |
50 inline void Thread::set_has_async_exception() { |
50 inline void Thread::set_has_async_exception() { |
51 set_suspend_flag(_has_async_exception); |
51 set_suspend_flag(_has_async_exception); |
52 } |
52 } |
81 } |
81 } |
82 return allocated_bytes; |
82 return allocated_bytes; |
83 } |
83 } |
84 |
84 |
85 inline ThreadsList* Thread::cmpxchg_threads_hazard_ptr(ThreadsList* exchange_value, ThreadsList* compare_value) { |
85 inline ThreadsList* Thread::cmpxchg_threads_hazard_ptr(ThreadsList* exchange_value, ThreadsList* compare_value) { |
86 return (ThreadsList*)Atomic::cmpxchg(exchange_value, &_threads_hazard_ptr, compare_value); |
86 return (ThreadsList*)Atomic::cmpxchg(&_threads_hazard_ptr, compare_value, exchange_value); |
87 } |
87 } |
88 |
88 |
89 inline ThreadsList* Thread::get_threads_hazard_ptr() { |
89 inline ThreadsList* Thread::get_threads_hazard_ptr() { |
90 return (ThreadsList*)Atomic::load_acquire(&_threads_hazard_ptr); |
90 return (ThreadsList*)Atomic::load_acquire(&_threads_hazard_ptr); |
91 } |
91 } |