forked from len0rd/rockbox
buflib: Check the validity of of handles passed to buflib_get_data() in DEBUG builds.
Change-Id: Ic274bfb4a8e1a1a10f9a54186b9173dbc0faa4c8
This commit is contained in:
parent
d608d2203a
commit
d66346789c
6 changed files with 326 additions and 2 deletions
21
firmware/kernel/pthread/mutex.c
Normal file
21
firmware/kernel/pthread/mutex.c
Normal file
|
@ -0,0 +1,21 @@
|
|||
#include <pthread.h>
|
||||
#include "kernel.h"
|
||||
|
||||
void mutex_init(struct mutex *m)
|
||||
{
|
||||
pthread_mutexattr_t attr;
|
||||
pthread_mutexattr_init(&attr);
|
||||
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
|
||||
pthread_mutex_init(&m->mutex, &attr);
|
||||
pthread_mutexattr_destroy(&attr);
|
||||
}
|
||||
|
||||
void mutex_lock(struct mutex *m)
|
||||
{
|
||||
pthread_mutex_lock(&m->mutex);
|
||||
}
|
||||
|
||||
void mutex_unlock(struct mutex *m)
|
||||
{
|
||||
pthread_mutex_unlock(&m->mutex);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue