summaryrefslogtreecommitdiff
path: root/sysdeps/generic/pt-mutex-timedlock.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/generic/pt-mutex-timedlock.c')
-rw-r--r--sysdeps/generic/pt-mutex-timedlock.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sysdeps/generic/pt-mutex-timedlock.c b/sysdeps/generic/pt-mutex-timedlock.c
index 6db30c5d..265a4530 100644
--- a/sysdeps/generic/pt-mutex-timedlock.c
+++ b/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;