Commit 99ed3572 authored by Pekka Pessi's avatar Pekka Pessi
Browse files

Fixed test code for pthread_rwlock_trywrlock().

darcs-hash:20060107123100-65a35-c6fb9ed9de847034dfa1b53cb0047958a8db225f.gz
parent 8d1a9b66
...@@ -256,12 +256,12 @@ pthread_rwlock_t rw; ...@@ -256,12 +256,12 @@ pthread_rwlock_t rw;
int main() int main()
{ {
pthread_rwlock_init(&rw); pthread_rwlock_init(&rw, NULL);
pthread_rwlock_rdlock(&rw); pthread_rwlock_rdlock(&rw);
pthread_rwlock_rdlock(&rw); pthread_rwlock_rdlock(&rw);
pthread_rwlock_unlock(&rw); pthread_rwlock_unlock(&rw);
/* pthread_rwlock_trywrlock() should fail with -1 */ /* pthread_rwlock_trywrlock() should fail (not return 0) */
return pthread_rwlock_trywrlock(&rw) == -1 ? 0 : 1; return pthread_rwlock_trywrlock(&rw) != 0 ? 0 : 1;
} }
],[AC_DEFINE_HAVE_PTHREAD_RWLOCK],[ ],[AC_DEFINE_HAVE_PTHREAD_RWLOCK],[
AC_MSG_WARN([Recursive pthread_rwlock_rdlock() does not work!!! ]) AC_MSG_WARN([Recursive pthread_rwlock_rdlock() does not work!!! ])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment