8194691: Cleanup unnecessary casts in Atomic/OrderAccess uses

Removed unnecessary casts.

Reviewed-by: coleenp, tschatzl
This commit is contained in:
Kim Barrett 2018-02-11 03:12:15 -05:00
parent f4c6bc0030
commit 7f0f329daf
14 changed files with 43 additions and 46 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -30,24 +30,18 @@
#include "runtime/thread.hpp"
inline void Thread::set_suspend_flag(SuspendFlags f) {
assert(sizeof(jint) == sizeof(_suspend_flags), "size mismatch");
uint32_t flags;
do {
flags = _suspend_flags;
}
while (Atomic::cmpxchg((jint)(flags | f),
(volatile jint*)&_suspend_flags,
(jint)flags) != (jint)flags);
while (Atomic::cmpxchg((flags | f), &_suspend_flags, flags) != flags);
}
inline void Thread::clear_suspend_flag(SuspendFlags f) {
assert(sizeof(jint) == sizeof(_suspend_flags), "size mismatch");
uint32_t flags;
do {
flags = _suspend_flags;
}
while (Atomic::cmpxchg((jint)(flags & ~f),
(volatile jint*)&_suspend_flags,
(jint)flags) != (jint)flags);
while (Atomic::cmpxchg((flags & ~f), &_suspend_flags, flags) != flags);
}
inline void Thread::set_has_async_exception() {