From: Bart Van Assche Date: Sat, 11 Jul 2009 15:02:27 +0000 (+0000) Subject: pth_cleanup_handler test compiles and runs now on systems that do not support reader... X-Git-Tag: svn/VALGRIND_3_5_0~417 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=97dac310443dc926cb3e24b841f498d864f2ebe8;p=thirdparty%2Fvalgrind.git pth_cleanup_handler test compiles and runs now on systems that do not support reader-writer locks too. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10430 --- diff --git a/drd/tests/pth_cleanup_handler.c b/drd/tests/pth_cleanup_handler.c index 963414c853..ada1750848 100644 --- a/drd/tests/pth_cleanup_handler.c +++ b/drd/tests/pth_cleanup_handler.c @@ -11,20 +11,20 @@ #include -static pthread_rwlock_t rwl; +static pthread_mutex_t s_mutex; static void cleanup_handler(void* param) { fprintf(stderr, "Cleanup handler has been called.\n"); - pthread_rwlock_unlock(&rwl); + pthread_mutex_unlock(&s_mutex); } static void* f(void *p) { - if (pthread_rwlock_rdlock(&rwl) != 0) + if (pthread_mutex_lock(&s_mutex) != 0) { - fprintf(stderr, "pthread_rwlock_rdlock()\n"); + fprintf(stderr, "pthread_mutex_lock()\n"); exit(1); } @@ -41,9 +41,9 @@ int main() // Make sure the program exits in case a deadlock has been triggered. alarm(2); - if (pthread_rwlock_init(&rwl, NULL) != 0) + if (pthread_mutex_init(&s_mutex, NULL) != 0) { - fprintf(stderr, "pthread_rwlock_init()\n"); + fprintf(stderr, "pthread_mutex_init()\n"); exit(1); } if (pthread_create(&pt1, NULL, f, NULL) != 0)