pshared: Improve mutex_init_pshared_with_type()
authorBart Van Assche <bvanassche@acm.org>
Sat, 30 May 2020 23:03:48 +0000 (16:03 -0700)
committerBart Van Assche <bvanassche@acm.org>
Wed, 10 Jun 2020 02:28:06 +0000 (19:28 -0700)
commiteac54d731105e814203a94d00d791f50280a9d71
tree901c0553e71f423a0401c576bf9ed73d5334a6cc
parentd87d9c6c611f74a5888c74568d545be200139498
pshared: Improve mutex_init_pshared_with_type()

Skipping the pthread_mutexattr_settype() call if type == 0 is questionable
because it makes it impossible to initialize a mutex with type == 0 (type 0
corresponds to PTHREAD_MUTEX_TIMED_NP on Linux). Use symbolic names for
pthread mutex types and leave out the type == 0 check.

Fixes: 3ed6894b00c4 ("pshared: Add mutex_init_pshared_with_type()")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
pshared.c