1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-18 03:09:13 +00:00

More std::atomic and friends

This commit is contained in:
2014-04-08 21:38:46 -07:00
parent 23a071860e
commit 34b2eb1836
15 changed files with 61 additions and 94 deletions

View File

@ -815,10 +815,10 @@ void NetCommActivatePostInitErrorHandler () {
//============================================================================
void NetCommUpdate () {
// plClient likes to recursively call us on occasion; debounce that crap.
static long s_updating;
if (0 == AtomicSet(&s_updating, 1)) {
static std::atomic_flag s_updating = ATOMIC_FLAG_INIT;
if (!s_updating.test_and_set()) {
NetClientUpdate();
AtomicSet(&s_updating, 0);
s_updating.clear();
}
}