Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/bind/include/isc Fix non-threads compatibility ...
details: https://anonhg.NetBSD.org/src/rev/8f5771990667
branches: trunk
changeset: 760060:8f5771990667
user: christos <christos%NetBSD.org@localhost>
date: Sat Dec 25 15:26:32 2010 +0000
description:
Fix non-threads compatibility code which was causing trouble even in the
threaded version.
diffstat:
external/bsd/bind/include/isc/atomic.h | 10 +++++-----
external/bsd/bind/include/isc/platform.h | 3 ---
2 files changed, 5 insertions(+), 8 deletions(-)
diffs (55 lines):
diff -r 2ee268f3ef91 -r 8f5771990667 external/bsd/bind/include/isc/atomic.h
--- a/external/bsd/bind/include/isc/atomic.h Sat Dec 25 15:05:22 2010 +0000
+++ b/external/bsd/bind/include/isc/atomic.h Sat Dec 25 15:26:32 2010 +0000
@@ -1,9 +1,9 @@
-/* $NetBSD: atomic.h,v 1.2 2010/12/14 23:19:23 christos Exp $ */
+/* $NetBSD: atomic.h,v 1.3 2010/12/25 15:26:32 christos Exp $ */
#ifndef ISC_ATOMIC_H
#define ISC_ATOMIC_H 1
-#ifdef ISC_PLATFORM_USE_THREADS
+#ifdef ISC_PLATFORM_USETHREADS
#include <sys/atomic.h>
#else
#define ISC_NO_ATOMIC
@@ -18,7 +18,7 @@
isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) {
#ifdef ISC_NO_ATOMIC
isc_int32_t oval = *p;
- *p = val;
+ *p += val;
return oval;
#else
return (isc_int32_t)atomic_add_32_nv((volatile uint32_t *)p,
@@ -31,7 +31,7 @@
isc_atomic_xaddq(isc_int64_t *p, isc_int64_t val) {
#ifdef ISC_NO_ATOMIC
isc_int64_t oval = *p;
- *p = val;
+ *p += val;
return oval;
#else
return (isc_int64_t)atomic_add_64_nv((volatile uint64_t *)p,
@@ -61,7 +61,7 @@
isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) {
#ifdef ISC_NO_ATOMIC
isc_int32_t oval = *p;
- if (oval == val)
+ if (cmpval == oval)
*p = val;
return oval;
#else
diff -r 2ee268f3ef91 -r 8f5771990667 external/bsd/bind/include/isc/platform.h
--- a/external/bsd/bind/include/isc/platform.h Sat Dec 25 15:05:22 2010 +0000
+++ b/external/bsd/bind/include/isc/platform.h Sat Dec 25 15:26:32 2010 +0000
@@ -25,9 +25,6 @@
/*****
***** Platform-dependent defines.
*****/
-#ifdef ISC_PLATFORM_USE_THREADS
-#include <sys/atomic.h>
-#endif
/***
*** Network.
Home |
Main Index |
Thread Index |
Old Index