Resolved the name clashing caused by the introduction of atomic_set() and

atomic_test_and_set() to the OpenBeOS headers (prefixed BFS versions with '_').


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4446 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2003-09-02 04:26:04 +00:00
parent 20743a3a67
commit 161915fd91
2 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -457,7 +457,7 @@ class SimpleLock {
{ {
int32 thisThread = find_thread(NULL); int32 thisThread = find_thread(NULL);
int32 current; int32 current;
while ((current = atomic_test_and_set(&fHolder, thisThread, -1)) != -1) { while ((current = _atomic_test_and_set(&fHolder, thisThread, -1)) != -1) {
if (current == thisThread) if (current == thisThread)
break; break;
@@ -473,7 +473,7 @@ class SimpleLock {
void Unlock() void Unlock()
{ {
if (atomic_add(&fCount, -1) == 1) if (atomic_add(&fCount, -1) == 1)
atomic_set(&fHolder, -1); _atomic_set(&fHolder, -1);
} }
bool IsLocked() const bool IsLocked() const
@@ -109,9 +109,9 @@ template<class Node> struct list {
// Some atomic operations that are somehow missing in BeOS: // Some atomic operations that are somehow missing in BeOS:
// //
// atomic_test_and_set(value, newValue, testAgainst) // _atomic_test_and_set(value, newValue, testAgainst)
// sets "value" to "newValue", if "value" is equal to "testAgainst" // sets "value" to "newValue", if "value" is equal to "testAgainst"
// atomic_set(value, newValue) // _atomic_set(value, newValue)
// sets "value" to "newValue" // sets "value" to "newValue"
#if _NO_INLINE_ASM #if _NO_INLINE_ASM
@@ -119,7 +119,7 @@ template<class Node> struct list {
// They are only used for single processor user space tests // They are only used for single processor user space tests
// (and don't even work correctly there) // (and don't even work correctly there)
inline int32 inline int32
atomic_test_and_set(volatile int32 *value, int32 newValue, int32 testAgainst) _atomic_test_and_set(volatile int32 *value, int32 newValue, int32 testAgainst)
{ {
int32 oldValue = *value; int32 oldValue = *value;
if (oldValue == testAgainst) if (oldValue == testAgainst)
@@ -129,13 +129,13 @@ template<class Node> struct list {
} }
inline void inline void
atomic_set(volatile int32 *value, int32 newValue) _atomic_set(volatile int32 *value, int32 newValue)
{ {
*value = newValue; *value = newValue;
} }
#elif __INTEL__ #elif __INTEL__
inline int32 inline int32
atomic_test_and_set(volatile int32 *value, int32 newValue, int32 testAgainst) _atomic_test_and_set(volatile int32 *value, int32 newValue, int32 testAgainst)
{ {
int32 oldValue; int32 oldValue;
asm volatile("lock; cmpxchg %%ecx, (%%edx)" asm volatile("lock; cmpxchg %%ecx, (%%edx)"
@@ -144,13 +144,13 @@ template<class Node> struct list {
} }
inline void inline void
atomic_set(volatile int32 *value, int32 newValue) _atomic_set(volatile int32 *value, int32 newValue)
{ {
asm volatile("lock; xchg %%eax, (%%edx)" asm volatile("lock; xchg %%eax, (%%edx)"
: : "a" (newValue), "d" (value)); : : "a" (newValue), "d" (value));
} }
#else #else
# error The macros atomic_set(), and atomic_test_and_set() are not defined for the target processor # error The macros _atomic_set(), and _atomic_test_and_set() are not defined for the target processor
#endif #endif