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:
Nathan Froyd 2015-03-10 14:41:45 -04:00
parent 8c2657fa26
commit e7363b8b6b

View File

@ -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;