switch rdi_from_pdb to new async layer, off of old task system

This commit is contained in:
Ryan Fleury
2024-11-01 14:44:56 -07:00
parent 86d9b792d8
commit 79bcbe4b39
7 changed files with 3055 additions and 216 deletions
+18 -4
View File
@@ -1,6 +1,16 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
////////////////////////////////
//~ rjf: Basic Type Functions
internal ASYNC_Task
async_task_zero(void)
{
ASYNC_Task task = {0};
return task;
}
////////////////////////////////
//~ rjf: Top-Level Layer Initialization
@@ -103,10 +113,14 @@ async_task_launch_(ASYNC_WorkFunctionType *work_function, ASYNC_WorkParams *para
internal void *
async_task_join(ASYNC_Task task)
{
os_semaphore_take(task.semaphore, max_U64);
os_semaphore_release(task.semaphore);
MemoryZeroStruct(&task.semaphore);
void *result = (void *)ins_atomic_u64_eval(&task.output);
void *result = 0;
if(!os_handle_match(task.semaphore, os_handle_zero()))
{
os_semaphore_take(task.semaphore, max_U64);
os_semaphore_release(task.semaphore);
MemoryZeroStruct(&task.semaphore);
result = (void *)ins_atomic_u64_eval(&task.output);
}
return result;
}
+6 -1
View File
@@ -85,6 +85,11 @@ struct ASYNC_Shared
global ASYNC_Shared *async_shared = 0;
////////////////////////////////
//~ rjf: Basic Type Functions
internal ASYNC_Task async_task_zero(void);
////////////////////////////////
//~ rjf: Top-Level Layer Initialization
@@ -106,7 +111,7 @@ internal B32 async_push_work_(ASYNC_WorkFunctionType *work_function, ASYNC_WorkP
internal void async_task_list_push(Arena *arena, ASYNC_TaskList *list, ASYNC_Task t);
internal ASYNC_Task async_task_launch_(ASYNC_WorkFunctionType *work_function, ASYNC_WorkParams *params);
#define async_task_kickoff(work_function, ...) async_task_kickoff_((work_function), &(ASYNC_WorkParams){.endt_us = max_U64, __VA_ARGS__})
#define async_task_launch(work_function, ...) async_task_launch_((work_function), &(ASYNC_WorkParams){.endt_us = max_U64, __VA_ARGS__})
internal void *async_task_join(ASYNC_Task task);
#define async_task_join_struct(task, T) (T *)async_task_join(task)