bug 887854 - remove most useage of pratom.h r=mounir, mcmanus, jrmuizel

This commit is contained in:
Trevor Saunders 2013-06-16 03:09:07 -04:00
parent fc33db660b
commit 2af42ae713
10 changed files with 13 additions and 19 deletions

View File

@ -11,7 +11,6 @@
#include "MediaPluginHost.h"
#include "nsXPCOMStrings.h"
#include "nsISeekableStream.h"
#include "pratom.h"
#include "MediaPluginReader.h"
#include "nsIGfxInfo.h"
#include "gfxCrashReporterUtils.h"

View File

@ -29,11 +29,11 @@
#include <cstdio>
#include <dbus/dbus.h>
#include "pratom.h"
#include "nsAutoPtr.h"
#include "nsThreadUtils.h"
#include "nsDebug.h"
#include "nsDataHashtable.h"
#include "mozilla/Atomics.h"
#include "mozilla/Hal.h"
#include "mozilla/ipc/UnixSocket.h"
#include "mozilla/ipc/DBusThread.h"
@ -151,7 +151,7 @@ static const char* sBluetoothDBusSignals[] =
static nsAutoPtr<RawDBusConnection> gThreadConnection;
static nsDataHashtable<nsStringHashKey, DBusMessage* > sPairingReqTable;
static nsDataHashtable<nsStringHashKey, DBusMessage* > sAuthorizeReqTable;
static int32_t sIsPairing = 0;
static Atomic<int32_t> sIsPairing;
static nsString sAdapterPath;
typedef void (*UnpackFunc)(DBusMessage*, DBusError*, BluetoothValue&, nsAString&);
@ -456,7 +456,7 @@ GetObjectPathCallback(DBusMessage* aMsg, void* aBluetoothReplyRunnable)
if (sIsPairing) {
RunDBusCallback(aMsg, aBluetoothReplyRunnable,
UnpackObjectPathMessage);
PR_AtomicDecrement(&sIsPairing);
sIsPairing--;
}
}
@ -1678,7 +1678,7 @@ BluetoothDBusService::StopInternal()
sAuthorizeReqTable.EnumerateRead(UnrefDBusMessages, nullptr);
sAuthorizeReqTable.Clear();
PR_AtomicSet(&sIsPairing, 0);
sIsPairing = 0;
StopDBus();
return NS_OK;
@ -2173,7 +2173,7 @@ BluetoothDBusService::CreatePairedDeviceInternal(
*
* Please see Bug 818696 for more information.
*/
PR_AtomicIncrement(&sIsPairing);
sIsPairing++;
nsRefPtr<BluetoothReplyRunnable> runnable = aRunnable;
// Then send CreatePairedDevice, it will register a temp device agent then

View File

@ -9,7 +9,6 @@
#include "nspr.h"
#include "nsString.h"
#include "pratom.h"
#include "nsUniversalCharDetDll.h"
#include "nsISupports.h"
#include "nsICategoryManager.h"

View File

@ -4,7 +4,6 @@
#include "gfxReusableSurfaceWrapper.h"
#include "gfxImageSurface.h"
#include "pratom.h"
gfxReusableSurfaceWrapper::gfxReusableSurfaceWrapper(gfxImageSurface* aSurface)
: mSurface(aSurface)
@ -42,13 +41,13 @@ void
gfxReusableSurfaceWrapper::ReadLock()
{
NS_CheckThreadSafe(_mOwningThread.GetThread(), "Only the owner thread can call ReadOnlyLock");
PR_ATOMIC_INCREMENT(&mReadCount);
mReadCount++;
}
void
gfxReusableSurfaceWrapper::ReadUnlock()
{
PR_ATOMIC_DECREMENT(&mReadCount);
mReadCount--;
NS_ABORT_IF_FALSE(mReadCount >= 0, "Should not be negative");
}

View File

@ -8,6 +8,7 @@
#include "gfxASurface.h"
#include "nsISupportsImpl.h"
#include "nsAutoPtr.h"
#include "mozilla/Atomics.h"
class gfxImageSurface;
@ -66,7 +67,7 @@ private:
nsRefPtr<gfxImageSurface> mSurface;
const gfxASurface::gfxImageFormat mFormat;
const unsigned char* mSurfaceData;
int32_t mReadCount;
mozilla::Atomic<int32_t> mReadCount;
};
#endif // GFXCOWSURFACEWRAPPER

View File

@ -9,7 +9,6 @@
#include "nsStringGlue.h"
#include "nsThreadUtils.h"
#include "nsXULAppAPI.h"
#include "pratom.h"
#include "prthread.h"
#include "base/logging.h"

View File

@ -8,7 +8,6 @@
#define nsJAR_h__
#include "nscore.h"
#include "pratom.h"
#include "prio.h"
#include "plstr.h"
#include "prlog.h"

View File

@ -16,7 +16,7 @@
#include "nsIInputStream.h"
#include "nsIOutputStream.h"
#include "pratom.h"
#include "mozilla/Atomics.h"
class nsDiskCacheInputStream;
class nsDiskCacheDevice;
@ -34,10 +34,10 @@ public:
nsresult ClearBinding();
void IncrementInputStreamCount() { PR_ATOMIC_INCREMENT(&mInStreamCount); }
void IncrementInputStreamCount() { mInStreamCount++; }
void DecrementInputStreamCount()
{
PR_ATOMIC_DECREMENT(&mInStreamCount);
mInStreamCount--;
NS_ASSERTION(mInStreamCount >= 0, "mInStreamCount has gone negative");
}
@ -58,7 +58,7 @@ private:
nsDiskCacheBinding * mBinding; // not an owning reference
nsDiskCacheDevice * mDevice;
int32_t mInStreamCount;
mozilla::Atomic<int32_t> mInStreamCount;
PRFileDesc * mFD;
uint32_t mStreamEnd; // current size of data

View File

@ -22,7 +22,6 @@
#include "nsISupportsBase.h"
#include "nsISupportsUtils.h"
#include "nsAutoPtr.h"
#include "pratom.h"
#include "prthread.h"
#include "prerror.h"
#include "prtime.h"

View File

@ -10,7 +10,6 @@
#include "mozStorageService.h"
#include "mozStorageConnection.h"
#include "prinit.h"
#include "pratom.h"
#include "nsAutoPtr.h"
#include "nsCollationCID.h"
#include "nsEmbedCID.h"