forked from Hay1tsme/segatools
refactor all common parts and games
This commit is contained in:
24
common/util/async.h
Normal file
24
common/util/async.h
Normal file
@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "hook/iohook.h"
|
||||
|
||||
typedef HRESULT (*async_task_t)(void *ctx, struct irp *irp);
|
||||
|
||||
struct async {
|
||||
CRITICAL_SECTION lock;
|
||||
CONDITION_VARIABLE pend;
|
||||
CONDITION_VARIABLE avail;
|
||||
HANDLE thread;
|
||||
struct irp irp;
|
||||
async_task_t task;
|
||||
void *ctx;
|
||||
bool stop;
|
||||
};
|
||||
|
||||
void async_init(struct async *async, void *ctx);
|
||||
void async_fini(struct async *async);
|
||||
HRESULT async_submit(struct async *async, struct irp *irp, async_task_t task);
|
Reference in New Issue
Block a user