mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-27 07:34:20 +00:00
bug 887854 - remove most useage of pratom.h r=mounir, mcmanus, jrmuizel
This commit is contained in:
parent
fc33db660b
commit
2af42ae713
@ -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"
|
||||
|
@ -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
|
||||
|
@ -9,7 +9,6 @@
|
||||
|
||||
#include "nspr.h"
|
||||
#include "nsString.h"
|
||||
#include "pratom.h"
|
||||
#include "nsUniversalCharDetDll.h"
|
||||
#include "nsISupports.h"
|
||||
#include "nsICategoryManager.h"
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "nsStringGlue.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsXULAppAPI.h"
|
||||
#include "pratom.h"
|
||||
#include "prthread.h"
|
||||
|
||||
#include "base/logging.h"
|
||||
|
@ -8,7 +8,6 @@
|
||||
#define nsJAR_h__
|
||||
|
||||
#include "nscore.h"
|
||||
#include "pratom.h"
|
||||
#include "prio.h"
|
||||
#include "plstr.h"
|
||||
#include "prlog.h"
|
||||
|
8
netwerk/cache/nsDiskCacheStreams.h
vendored
8
netwerk/cache/nsDiskCacheStreams.h
vendored
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user