aboutsummaryrefslogtreecommitdiff
path: root/test/tsan/cond_cancel.c
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-09-06 18:41:23 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-09-06 18:41:23 +0000
commitf31bcc68c72371a2bf63aead9f3373a1ff2053b6 (patch)
treeb259e5d585da0f8cde9579939a74d5ef44c72abd /test/tsan/cond_cancel.c
parentcd2dd3df15523e2be8d2bbace27641d6ac9fa40d (diff)
downloadsrc-f31bcc68c72371a2bf63aead9f3373a1ff2053b6.tar.gz
src-f31bcc68c72371a2bf63aead9f3373a1ff2053b6.zip
Import compiler-rt 3.7.0 release (r246257).vendor/compiler-rt/compiler-rt-release_370-r246257
Notes
Notes: svn path=/vendor/compiler-rt/dist/; revision=287516 svn path=/vendor/compiler-rt/compiler-rt-release_370-r246257/; revision=287517; tag=vendor/compiler-rt/compiler-rt-release_370-r246257
Diffstat (limited to 'test/tsan/cond_cancel.c')
-rw-r--r--test/tsan/cond_cancel.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/tsan/cond_cancel.c b/test/tsan/cond_cancel.c
index e744570b12fc..ddfb745174f6 100644
--- a/test/tsan/cond_cancel.c
+++ b/test/tsan/cond_cancel.c
@@ -8,9 +8,14 @@ pthread_mutex_t m;
pthread_cond_t c;
int x;
+static void my_cleanup(void *arg) {
+ printf("my_cleanup\n");
+ pthread_mutex_unlock((pthread_mutex_t*)arg);
+}
+
void *thr1(void *p) {
pthread_mutex_lock(&m);
- pthread_cleanup_push((void(*)(void *arg))pthread_mutex_unlock, &m);
+ pthread_cleanup_push(my_cleanup, &m);
barrier_wait(&barrier);
while (x == 0)
pthread_cond_wait(&c, &m);