refactor: Entire code base, thread and log usage

Boils down to:
- Include headers
- Reduce boiler plate with helpers
- Swap out explicit usages with core API layer
  and ensure the right API is configured beforehand
This commit is contained in:
icex2
2024-08-14 17:53:51 +02:00
parent 82d1a2df52
commit 93e0a090bc
338 changed files with 1307 additions and 641 deletions
+1
View File
@@ -1,6 +1,7 @@
libs += aciodrv-proc
libs_aciodrv-proc := \
core \
src_aciodrv-proc := \
panb.c \
+6 -5
View File
@@ -5,8 +5,9 @@
#include "aciodrv/device.h"
#include "aciodrv/panb.h"
#include "util/log.h"
#include "util/thread.h"
#include "core/thread.h"
#include "core/log.h"
static int auto_poll_proc(void *auto_poll_param);
static int auto_poll_threadid;
@@ -50,7 +51,7 @@ bool aciodrv_proc_panb_init(struct aciodrv_device_ctx *device)
InitializeCriticalSection(&keypair_lock);
InitializeCriticalSection(&auto_poll_stop_lock);
auto_poll_threadid =
thread_create(auto_poll_proc, (void *) device, 0x4000, 0);
core_thread_create(auto_poll_proc, (void *) device, 0x4000, 0);
return true;
}
@@ -80,8 +81,8 @@ void aciodrv_proc_panb_fini(struct aciodrv_device_ctx *device)
auto_poll_stop = true;
LeaveCriticalSection(&auto_poll_stop_lock);
thread_join(auto_poll_threadid, NULL);
thread_destroy(auto_poll_threadid);
core_thread_join(auto_poll_threadid, NULL);
core_thread_destroy(auto_poll_threadid);
DeleteCriticalSection(&keypair_lock);
DeleteCriticalSection(&auto_poll_stop_lock);