aboutsummaryrefslogtreecommitdiff
path: root/libgo/runtime/go-semacquire.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2011-11-22 20:24:44 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-11-22 20:24:44 +0000
commit48e7d50e9f4e4d866e12383bd76a0e488eb14c54 (patch)
treef19dd9facaf8d0ad06290f19a199cc449393ffdd /libgo/runtime/go-semacquire.c
parent2195c9beb6abfb06b7981643e2f3ea926ec0593b (diff)
downloadgcc-48e7d50e9f4e4d866e12383bd76a0e488eb14c54.zip
gcc-48e7d50e9f4e4d866e12383bd76a0e488eb14c54.tar.gz
gcc-48e7d50e9f4e4d866e12383bd76a0e488eb14c54.tar.bz2
runtime: New lock/note implementation.
From-SVN: r181633
Diffstat (limited to 'libgo/runtime/go-semacquire.c')
-rw-r--r--libgo/runtime/go-semacquire.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/libgo/runtime/go-semacquire.c b/libgo/runtime/go-semacquire.c
index 05b6377..7c77c0b 100644
--- a/libgo/runtime/go-semacquire.c
+++ b/libgo/runtime/go-semacquire.c
@@ -117,35 +117,3 @@ runtime_semrelease (uint32 *addr)
__go_assert (i == 0);
}
}
-
-
-#ifndef HAVE_SYNC_FETCH_AND_ADD_4
-
-/* For targets which don't have the required sync support. Really
- this should be provided by gcc itself. FIXME. */
-
-static pthread_mutex_t sync_lock = PTHREAD_MUTEX_INITIALIZER;
-
-uint32
-__sync_fetch_and_add_4(uint32*, uint32)
- __attribute__((visibility("hidden")));
-
-uint32
-__sync_fetch_and_add_4(uint32* ptr, uint32 add)
-{
- int i;
- uint32 ret;
-
- i = pthread_mutex_lock(&sync_lock);
- __go_assert(i == 0);
-
- ret = *ptr;
- *ptr += add;
-
- i = pthread_mutex_unlock(&sync_lock);
- __go_assert(i == 0);
-
- return ret;
-}
-
-#endif