Fix bug in pthread_rwlock_init
authorDavid Bartley <dtbartle@maltodextrin.csclub.uwaterloo.ca>
Fri, 29 Aug 2008 15:20:24 +0000 (15:20 +0000)
committerDavid Bartley <dtbartle@maltodextrin.csclub.uwaterloo.ca>
Fri, 29 Aug 2008 15:20:24 +0000 (15:20 +0000)
nptl/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/pthread_rwlock_init.c

index 2ff2bc2..586ac55 100644 (file)
@@ -42,10 +42,10 @@ __pthread_rwlock_init (rwlock, attr)
   iattr = ((const struct pthread_rwlockattr *) attr) ?: &default_attr;
 
   memset (rwlock, 0, sizeof(pthread_rwlock_t));
-  rwlock->type = iattr->pshared;
-  rwlock->magic = RWL_MAGIC;
-  rwlock->mutex.mutex_type = iattr->pshared |
+  rwlock->type = iattr->pshared |
       (iattr->lockkind << PTHREAD_RWLOCK_TYPE_SHIFT);
+  rwlock->magic = RWL_MAGIC;
+  rwlock->mutex.mutex_type = iattr->pshared;
   rwlock->mutex.mutex_flag = LOCK_INITED;
   rwlock->mutex.mutex_magic = MUTEX_MAGIC;
   rwlock->readercv.cond_type = iattr->pshared;