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 d5966b6f1c
commit f64498b7da

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;