From c97e82524e336de3cc8f9afae1849697ec9189a9 Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Tue, 18 Jul 2017 11:55:04 -0400 Subject: [PATCH] fix linux comp bug --- platform_all/4ed_work_queues.cpp | 9 +-------- platform_linux/linux_4ed.cpp | 8 ++++++-- platform_win32/win32_4ed.cpp | 8 ++++++-- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/platform_all/4ed_work_queues.cpp b/platform_all/4ed_work_queues.cpp index c5919d03..9918a883 100644 --- a/platform_all/4ed_work_queues.cpp +++ b/platform_all/4ed_work_queues.cpp @@ -10,18 +10,11 @@ // TOP internal void -job_proc(System_Functions *system, void *lpParameter){ - Thread_Context *thread = (Thread_Context*)lpParameter; - Work_Queue *queue = win32vars.queues + thread->group_id; - Thread_Group *group = win32vars.groups + thread->group_id; - +job_proc(System_Functions *system, Thread_Context *thread, Work_Queue *queue, Thread_Group *group, Thread_Memory *thread_memory){ i32 thread_index = thread->id - 1; - i32 cancel_lock = group->cancel_lock0 + thread_index; i32 cancel_cv = group->cancel_cv0 + thread_index; - Thread_Memory *thread_memory = win32vars.thread_memory + thread_index; - if (thread_memory->size == 0){ i32 new_size = KB(64); thread_memory->data = system_memory_allocate(new_size); diff --git a/platform_linux/linux_4ed.cpp b/platform_linux/linux_4ed.cpp index 926b9304..dd9bf491 100644 --- a/platform_linux/linux_4ed.cpp +++ b/platform_linux/linux_4ed.cpp @@ -518,8 +518,12 @@ system_wait_on(Plat_Handle handle){ internal void* JobThreadProc(void* lpParameter){ - System_Functions *system = &win32vars.system; - job_proc(system, lpParameter); + Thread_Context *thread = (Thread_Context*)lpParameter; + Work_Queue *queue = linuxvars.queues + thread->group_id; + Thread_Group *group = linuxvars.groups + thread->group_id; + i32 thread_index = thread->id - 1; + Thread_Memory *memory = linuxvars.thread_memory + thread_index; + job_proc(&linuxvars.system, thread, queue, group, memory); InvalidCodePath; return(0); } diff --git a/platform_win32/win32_4ed.cpp b/platform_win32/win32_4ed.cpp index b830de4a..5567f632 100644 --- a/platform_win32/win32_4ed.cpp +++ b/platform_win32/win32_4ed.cpp @@ -371,8 +371,12 @@ system_wait_on(Plat_Handle handle){ internal DWORD CALL_CONVENTION JobThreadProc(LPVOID lpParameter){ - System_Functions *system = &win32vars.system; - job_proc(system, lpParameter); + Thread_Context *thread = (Thread_Context*)lpParameter; + Work_Queue *queue = win32vars.queues + thread->group_id; + Thread_Group *group = win32vars.groups + thread->group_id; + i32 thread_index = thread->id - 1; + Thread_Memory *memory = win32vars.thread_memory + thread_index; + job_proc(&win32vars.system, thread, queue, group, memory); InvalidCodePath; return(0); }