mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-23 13:22:40 +02:00
29 lines
439 B
C
29 lines
439 B
C
// Copyright 2018 plutoo
|
|
#pragma once
|
|
#include "kernel/svc.h"
|
|
#include "kernel/mutex.h"
|
|
#include "kernel/wait.h"
|
|
|
|
#define MAX_WAIT 0x40
|
|
|
|
typedef struct WaiterNode WaiterNode;
|
|
typedef struct Waiter Waiter;
|
|
|
|
struct WaiterNode
|
|
{
|
|
Waiter* owner;
|
|
s32 idx;
|
|
WaiterNode* prev;
|
|
WaiterNode* next;
|
|
};
|
|
|
|
struct Waiter
|
|
{
|
|
Mutex mutex;
|
|
Handle thread;
|
|
s32 signalled_idx;
|
|
|
|
WaiterNode nodes[MAX_WAIT];
|
|
size_t num_nodes;
|
|
};
|