summaryrefslogtreecommitdiff
path: root/cpp/src/IceUtil/Thread.cpp
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2002-01-04 15:13:56 +0000
committerMatthew Newhook <matthew@zeroc.com>2002-01-04 15:13:56 +0000
commit44b24e370eafb7d88afea649c788260322767fb1 (patch)
tree40d369e4abd642eae73b2ea88c09348c102ebd5f /cpp/src/IceUtil/Thread.cpp
parentfile RoutingTable.cpp was initially added on branch glacier. (diff)
downloadice-44b24e370eafb7d88afea649c788260322767fb1.tar.bz2
ice-44b24e370eafb7d88afea649c788260322767fb1.tar.xz
ice-44b24e370eafb7d88afea649c788260322767fb1.zip
icc changes to IceUtil/Shared.
Diffstat (limited to 'cpp/src/IceUtil/Thread.cpp')
-rw-r--r--cpp/src/IceUtil/Thread.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/cpp/src/IceUtil/Thread.cpp b/cpp/src/IceUtil/Thread.cpp
index 6d31d1770ae..f2121a1e45c 100644
--- a/cpp/src/IceUtil/Thread.cpp
+++ b/cpp/src/IceUtil/Thread.cpp
@@ -306,3 +306,35 @@ IceUtil::Thread::operator<(const Thread& rhs) const
}
#endif
+
+#ifdef never
+void ice_atomic_inc(ice_atomic_t *v)
+{
+ __asm__ __volatile__(
+ "lock ; incl %0"
+ :"=m" (v->counter)
+ :"m" (v->counter));
+}
+
+int ice_atomic_dec_and_test(ice_atomic_t *v)
+{
+
+ unsigned char c;
+ __asm__ __volatile__(
+ "lock ; decl %0; sete %1"
+ :"=m" (v->counter), "=qm" (c)
+ :"m" (v->counter) : "memory");
+ return c != 0;
+}
+
+int ice_atomic_exchange_add(int i, ice_atomic_t* v)
+{
+ int tmp = i;
+ __asm__ __volatile__(
+ "lock ; xadd %0,(%2)"
+ :"+r"(tmp), "=m"(v->counter)
+ :"r"(v), "m"(v->counter)
+ : "memory");
+ return tmp + i;
+}
+#endif