From 5613c9722adee921e16682c0a035f2a7567bd346 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 2 Jul 2011 12:02:10 +0200 Subject: [PATCH] Add placeholders for loadAcquire and storeRelease in the atomics This should be replaced later with proper loadAcquire and storeRelease functions in the architectures that require them. The code right now is enough for x86, x86-64 and IA-64. It's probably not good for ARM and MIPS. Change-Id: Iaa28a18cad64772539662439c2c14690ec26940f Reviewed-on: http://codereview.qt-project.org/5029 Reviewed-by: Qt Sanity Bot Reviewed-by: Bradley T. Hughes Reviewed-by: Lars Knoll --- src/corelib/thread/qbasicatomic.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h index 790d39bf42..6519d4e401 100644 --- a/src/corelib/thread/qbasicatomic.h +++ b/src/corelib/thread/qbasicatomic.h @@ -96,6 +96,11 @@ public: // Atomic API, implemented in qatomic_XXX.h + int load() const { return _q_value; } + int loadAcquire() { return _q_value; } + void store(int newValue) { _q_value = newValue; } + void storeRelease(int newValue) { _q_value = newValue; } + static bool isReferenceCountingNative(); static bool isReferenceCountingWaitFree(); @@ -185,6 +190,11 @@ public: // Atomic API, implemented in qatomic_XXX.h + T *load() const { return _q_value; } + T *loadAcquire() { return _q_value; } + void store(T *newValue) { _q_value = newValue; } + void storeRelease(T *newValue) { _q_value = newValue; } + static bool isTestAndSetNative(); static bool isTestAndSetWaitFree();