summaryrefslogtreecommitdiff
path: root/libpthread/sysdeps/generic/pt-mutex-timedlock.c
diff options
context:
space:
mode:
Diffstat (limited to 'libpthread/sysdeps/generic/pt-mutex-timedlock.c')
-rw-r--r--libpthread/sysdeps/generic/pt-mutex-timedlock.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/libpthread/sysdeps/generic/pt-mutex-timedlock.c b/libpthread/sysdeps/generic/pt-mutex-timedlock.c
index 6db30c5..265a453 100644
--- a/libpthread/sysdeps/generic/pt-mutex-timedlock.c
+++ b/libpthread/sysdeps/generic/pt-mutex-timedlock.c
@@ -141,15 +141,16 @@ __pthread_mutex_timedlock_internal (struct __pthread_mutex *mutex,
else
__pthread_block (self);
- if (! mutex->attr || mutex->attr->mutex_type == PTHREAD_MUTEX_NORMAL)
- {
#ifndef NDEBUG
- mutex->owner = self;
+ assert (mutex->owner == self);
#endif
- }
- else
+
+ if (mutex->attr)
switch (mutex->attr->mutex_type)
{
+ case PTHREAD_MUTEX_NORMAL:
+ break;
+
case PTHREAD_MUTEX_RECURSIVE:
assert (mutex->locks == 0);
mutex->locks = 1;