9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_RUNTIME_THREAD_INLINE_HPP
26 #define SHARE_VM_RUNTIME_THREAD_INLINE_HPP
27
28 #include "runtime/atomic.hpp"
29 #include "runtime/os.inline.hpp"
30 #include "runtime/thread.hpp"
31
32 inline void Thread::set_suspend_flag(SuspendFlags f) {
33 uint32_t flags;
34 do {
35 flags = _suspend_flags;
36 }
37 while (Atomic::cmpxchg((flags | f), &_suspend_flags, flags) != flags);
38 }
39 inline void Thread::clear_suspend_flag(SuspendFlags f) {
40 uint32_t flags;
41 do {
42 flags = _suspend_flags;
43 }
44 while (Atomic::cmpxchg((flags & ~f), &_suspend_flags, flags) != flags);
45 }
46
47 inline void Thread::set_has_async_exception() {
48 set_suspend_flag(_has_async_exception);
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_RUNTIME_THREAD_INLINE_HPP
26 #define SHARE_VM_RUNTIME_THREAD_INLINE_HPP
27
28 #include "runtime/atomic.hpp"
29 #include "runtime/orderAccess.inline.hpp"
30 #include "runtime/os.inline.hpp"
31 #include "runtime/thread.hpp"
32
33 inline void Thread::set_suspend_flag(SuspendFlags f) {
34 uint32_t flags;
35 do {
36 flags = _suspend_flags;
37 }
38 while (Atomic::cmpxchg((flags | f), &_suspend_flags, flags) != flags);
39 }
40 inline void Thread::clear_suspend_flag(SuspendFlags f) {
41 uint32_t flags;
42 do {
43 flags = _suspend_flags;
44 }
45 while (Atomic::cmpxchg((flags & ~f), &_suspend_flags, flags) != flags);
46 }
47
48 inline void Thread::set_has_async_exception() {
49 set_suspend_flag(_has_async_exception);
|