mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Bug 1141692 - use an actual Atomic for nsThreadPoolNaming::mCounter; r=bsmedberg
Marking a variable as volatile is never the right thing to do when dealing with threads. Use real atomic accesses instead.
This commit is contained in:
parent
8c2657fa26
commit
e7363b8b6b
@ -17,6 +17,7 @@
|
||||
#include "nsStringGlue.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "mozilla/Atomics.h"
|
||||
#include "mozilla/Likely.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -831,7 +832,7 @@ public:
|
||||
nsIThread* aThread = nullptr);
|
||||
|
||||
private:
|
||||
volatile uint32_t mCounter;
|
||||
mozilla::Atomic<uint32_t> mCounter;
|
||||
|
||||
nsThreadPoolNaming(const nsThreadPoolNaming&) = delete;
|
||||
void operator=(const nsThreadPoolNaming&) = delete;
|
||||
|
Loading…
Reference in New Issue
Block a user