diff options
author | Matthew Newhook <matthew@zeroc.com> | 2002-01-04 15:13:56 +0000 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2002-01-04 15:13:56 +0000 |
commit | 44b24e370eafb7d88afea649c788260322767fb1 (patch) | |
tree | 40d369e4abd642eae73b2ea88c09348c102ebd5f /cpp/src/IceUtil/Thread.cpp | |
parent | file RoutingTable.cpp was initially added on branch glacier. (diff) | |
download | ice-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.cpp | 32 |
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 |