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
18
firmware/kernel/pthread/corelock.c
Normal file
18
firmware/kernel/pthread/corelock.c
Normal file
|
@ -0,0 +1,18 @@
|
|||
#include <pthread.h>
|
||||
#include "kernel.h"
|
||||
|
||||
void corelock_init(struct corelock *lk)
|
||||
{
|
||||
lk->mutex = (pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER;
|
||||
}
|
||||
|
||||
void corelock_lock(struct corelock *lk)
|
||||
{
|
||||
pthread_mutex_lock(&lk->mutex);
|
||||
}
|
||||
|
||||
|
||||
void corelock_unlock(struct corelock *lk)
|
||||
{
|
||||
pthread_mutex_unlock(&lk->mutex);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue