From 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d Mon Sep 17 00:00:00 2001 From: Jef Date: Tue, 24 Sep 2024 14:54:57 +0200 Subject: Initial community commit --- Src/replicant/nx/win/nxthread.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Src/replicant/nx/win/nxthread.h (limited to 'Src/replicant/nx/win/nxthread.h') diff --git a/Src/replicant/nx/win/nxthread.h b/Src/replicant/nx/win/nxthread.h new file mode 100644 index 00000000..5b2c2561 --- /dev/null +++ b/Src/replicant/nx/win/nxthread.h @@ -0,0 +1,32 @@ + +#pragma once +#include "nx/nxapi.h" +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#include + +#ifdef __cplusplus +extern "C" { +#endif + + typedef struct nx_thread_struct_t { size_t dummy; } *nx_thread_t; + typedef DWORD nx_thread_return_t; + typedef void *nx_thread_parameter_t; +#define NXTHREADCALL CALLBACK + typedef nx_thread_return_t (NXTHREADCALL *nx_thread_func_t)(nx_thread_parameter_t parameter); + + // TODO: add parameters for things like stack size +NX_API int NXThreadCreate(nx_thread_t *thread, nx_thread_func_t thread_function, nx_thread_parameter_t parameter); +NX_API int NXThreadJoin(nx_thread_t t, nx_thread_return_t *retval); + +enum +{ + NX_THREAD_PRIORITY_PLAYBACK=THREAD_PRIORITY_HIGHEST, +}; +// sets priority of current thread +NX_API int NXThreadCurrentSetPriority(int priority); + +#ifdef __cplusplus +} +#endif \ No newline at end of file -- cgit