1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-18 11:19:10 +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

@ -133,8 +133,8 @@ static HASHTABLEDECL(TransState, THashKeyVal<unsigned>, link) s_trans;
static HASHTABLEDECL(IGameCli, THashKeyVal<unsigned>, link) s_games;
static std::map<plUUID, Factory*> s_factories;
static long s_transId;
static ARRAYOBJ(plKey) s_receivers;
static std::atomic<unsigned> s_transId;
static ARRAYOBJ(plKey) s_receivers;
/*****************************************************************************
@ -163,11 +163,7 @@ AUTO_INIT_FUNC (SetGameMgrMsgHandler) {
//============================================================================
static inline unsigned INextTransId () {
unsigned transId = AtomicAdd(&s_transId, 1);
while (!transId)
transId = AtomicAdd(&s_transId, 1);
return transId;
return ++s_transId;
}