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/globals.hpp"
30 #include "runtime/orderAccess.inline.hpp"
31 #include "runtime/os.inline.hpp"
32 #include "runtime/thread.hpp"
33
34 inline void Thread::set_suspend_flag(SuspendFlags f) {
35 uint32_t flags;
36 do {
37 flags = _suspend_flags;
38 }
39 while (Atomic::cmpxchg((flags | f), &_suspend_flags, flags) != flags);
40 }
41 inline void Thread::clear_suspend_flag(SuspendFlags f) {
42 uint32_t flags;
43 do {
44 flags = _suspend_flags;
45 }
46 while (Atomic::cmpxchg((flags & ~f), &_suspend_flags, flags) != flags);
47 }
48
49 inline void Thread::set_has_async_exception() {
50 set_suspend_flag(_has_async_exception);
|
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/globals.hpp"
30 #include "runtime/orderAccess.hpp"
31 #include "runtime/os.inline.hpp"
32 #include "runtime/thread.hpp"
33
34 inline void Thread::set_suspend_flag(SuspendFlags f) {
35 uint32_t flags;
36 do {
37 flags = _suspend_flags;
38 }
39 while (Atomic::cmpxchg((flags | f), &_suspend_flags, flags) != flags);
40 }
41 inline void Thread::clear_suspend_flag(SuspendFlags f) {
42 uint32_t flags;
43 do {
44 flags = _suspend_flags;
45 }
46 while (Atomic::cmpxchg((flags & ~f), &_suspend_flags, flags) != flags);
47 }
48
49 inline void Thread::set_has_async_exception() {
50 set_suspend_flag(_has_async_exception);
|