diff options
Diffstat (limited to 'firmware/kernel/pthread/corelock.c')
| -rw-r--r-- | firmware/kernel/pthread/corelock.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/firmware/kernel/pthread/corelock.c b/firmware/kernel/pthread/corelock.c new file mode 100644 index 0000000..10b4329 --- /dev/null +++ b/firmware/kernel/pthread/corelock.c @@ -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); +} |