2016-01-07 13:07:13 +01:00
|
|
|
#pragma once
|
|
|
|
#include <wut.h>
|
|
|
|
#include "threadqueue.h"
|
|
|
|
|
2016-01-07 14:02:17 +01:00
|
|
|
WUT_LIB_HEADER_START
|
2016-01-07 13:07:13 +01:00
|
|
|
|
|
|
|
typedef struct OSCondition OSCondition;
|
2016-01-07 13:45:18 +01:00
|
|
|
typedef struct OSMutex OSMutex;
|
2016-01-07 13:07:13 +01:00
|
|
|
|
2016-01-07 13:44:44 +01:00
|
|
|
#define OS_CONDITION_TAG 0x634E6456u
|
|
|
|
|
2016-01-07 13:07:13 +01:00
|
|
|
struct OSCondition
|
|
|
|
{
|
2016-01-07 13:44:44 +01:00
|
|
|
// OS_CONDITION_TAG
|
2016-01-07 13:07:13 +01:00
|
|
|
uint32_t tag;
|
|
|
|
|
|
|
|
// Name set by OSInitCondEx(condition, name)
|
|
|
|
const char *name;
|
|
|
|
|
|
|
|
UNKNOWN(4);
|
|
|
|
|
|
|
|
// Queue of threads waiting on condition
|
|
|
|
OSThreadQueue queue;
|
|
|
|
};
|
|
|
|
CHECK_OFFSET(OSCondition, 0x00, tag);
|
|
|
|
CHECK_OFFSET(OSCondition, 0x04, name);
|
|
|
|
CHECK_OFFSET(OSCondition, 0x0c, queue);
|
|
|
|
CHECK_SIZE(OSCondition, 0x1c);
|
|
|
|
|
|
|
|
void
|
|
|
|
OSInitCond(OSCondition *condition);
|
|
|
|
|
|
|
|
void
|
|
|
|
OSInitCondEx(OSCondition *condition,
|
|
|
|
const char *name);
|
|
|
|
|
|
|
|
void
|
|
|
|
OSWaitCond(OSCondition *condition,
|
|
|
|
OSMutex *mutex);
|
|
|
|
|
|
|
|
void
|
|
|
|
OSSignalCond(OSCondition *condition);
|
|
|
|
|
2016-01-07 14:02:17 +01:00
|
|
|
WUT_LIB_HEADER_END
|