mirror of https://github.com/ARMmbed/mbed-os.git
equeue posix impl: make queue mutex reentrant
parent
66da694625
commit
b336f73e77
|
@ -40,7 +40,10 @@ unsigned equeue_tick(void)
|
|||
// Mutex operations
|
||||
int equeue_mutex_create(equeue_mutex_t *m)
|
||||
{
|
||||
return pthread_mutex_init(m, 0);
|
||||
pthread_mutexattr_t attr;
|
||||
pthread_mutexattr_init(&attr);
|
||||
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
|
||||
return pthread_mutex_init(m, &attr);
|
||||
}
|
||||
|
||||
void equeue_mutex_destroy(equeue_mutex_t *m)
|
||||
|
|
|
@ -40,7 +40,10 @@ unsigned equeue_tick(void)
|
|||
// Mutex operations
|
||||
int equeue_mutex_create(equeue_mutex_t *m)
|
||||
{
|
||||
return pthread_mutex_init(m, 0);
|
||||
pthread_mutexattr_t attr;
|
||||
pthread_mutexattr_init(&attr);
|
||||
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
|
||||
return pthread_mutex_init(m, &attr);
|
||||
}
|
||||
|
||||
void equeue_mutex_destroy(equeue_mutex_t *m)
|
||||
|
|
Loading…
Reference in New Issue