summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Engert <kaie@kuix.de>2016-03-16 11:04:05 +0100
committerKai Engert <kaie@kuix.de>2016-03-16 11:04:05 +0100
commitf93db8068d277bd589116aff266f39a2f4e14980 (patch)
tree35b424cb82158bc17751ef01c141ae40475e894e
parent63f870bc201c3d5f10bed302a88a21b3e79e53ab (diff)
downloadnss-hg-f93db8068d277bd589116aff266f39a2f4e14980.tar.gz
Bug 1181814, don't use PR_ATOMIC_SET, instead use __sync_lock_test_and_set directly, to fix the build on 32-bit x86 Linux, without having to change NSPR. r=wtc
-rw-r--r--lib/freebl/lowhash_vector.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/lib/freebl/lowhash_vector.c b/lib/freebl/lowhash_vector.c
index 52fe6607c..b2557f8d4 100644
--- a/lib/freebl/lowhash_vector.c
+++ b/lib/freebl/lowhash_vector.c
@@ -103,12 +103,6 @@ freebl_LoadDSO( void )
}
static PRCallOnceType loadFreeBLOnce;
-/* remove when NSPR pratom.h is updated. s390 has atomic intrinsics,
- * but nspr doesn't know it. */
-#if defined(__s390__) || defined(__s390x__)
-#undef PR_ATOMIC_SET
-#define PR_ATOMIC_SET(val, newval) __sync_lock_test_and_set(val, newval)
-#endif
static PRStatus
freebl_RunLoaderOnce( void )
@@ -118,12 +112,7 @@ freebl_RunLoaderOnce( void )
if (loadFreeBLOnce.initialized) {
return loadFreeBLOnce.status;
}
- /* PR_ATOMIC_SET macro is implemented with compiler intrinsics, if we don't
- * have the intrinsic, it will be set to an NSPR PR_Atomic function, which
- * will show up as missing at build time. If we get that missing function,
- * Then we'll need to implement a PR_AtomicSet() function for that platform
- */
- if (PR_ATOMIC_SET(&loadFreeBLOnce.inProgress,1) == 0) {
+ if (__sync_lock_test_and_set(&loadFreeBLOnce.inProgress,1) == 0) {
loadFreeBLOnce.status = freebl_LoadDSO();
loadFreeBLOnce.initialized = 1;
} else {