mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-23 21:32:39 +02:00
Add rwlockInit (#155)
This commit is contained in:
parent
3513c91c3c
commit
377683acd5
@ -14,6 +14,12 @@ typedef struct {
|
||||
u64 b;
|
||||
} RwLock;
|
||||
|
||||
/**
|
||||
* @brief Initializes the read/write lock.
|
||||
* @param r Read/write lock object.
|
||||
*/
|
||||
void rwlockInit(RwLock* r);
|
||||
|
||||
/**
|
||||
* @brief Locks the read/write lock for reading.
|
||||
* @param r Read/write lock object.
|
||||
|
@ -2,6 +2,12 @@
|
||||
#include "kernel/mutex.h"
|
||||
#include "kernel/rwlock.h"
|
||||
|
||||
void rwlockInit(RwLock* r) {
|
||||
rmutexInit(&r->r);
|
||||
rmutexInit(&r->g);
|
||||
r->b = 0;
|
||||
}
|
||||
|
||||
void rwlockReadLock(RwLock* r) {
|
||||
rmutexLock(&r->r);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user