feat: reformatted code base to be more standard
This commit is contained in:
40
include/myke/tasks/locking.h
Normal file
40
include/myke/tasks/locking.h
Normal file
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// Created by rick on 27-02-21.
|
||||
//
|
||||
|
||||
#ifndef NEW_KERNEL_LOCKING_H
|
||||
#define NEW_KERNEL_LOCKING_H
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
typedef struct semaphore semaphore_t;
|
||||
|
||||
typedef struct mutex mutex_t;
|
||||
|
||||
typedef struct spinlock spinlock_t;
|
||||
|
||||
semaphore_t *semaphore_create(int32_t start);
|
||||
|
||||
void semaphore_wait(semaphore_t *semaphore);
|
||||
|
||||
void semaphore_signal(semaphore_t *semaphore);
|
||||
|
||||
void semaphore_free(semaphore_t *semaphore);
|
||||
|
||||
mutex_t *mutex_create();
|
||||
|
||||
void mutex_acquire(mutex_t *mutex);
|
||||
|
||||
void mutex_release(mutex_t *mutex);
|
||||
|
||||
void mutex_free(mutex_t *mutex);
|
||||
|
||||
spinlock_t *spinlock_create();
|
||||
|
||||
void spinlock_acquire(spinlock_t *spinlock);
|
||||
|
||||
void spinlock_release(spinlock_t *spinlock);
|
||||
|
||||
void spinlock_free(spinlock_t *spinlock);
|
||||
|
||||
#endif //NEW_KERNEL_LOCKING_H
|
||||
Reference in New Issue
Block a user