fix linux comp bug

This commit is contained in:
Allen Webster 2017-07-18 11:55:04 -04:00
parent 6908775450
commit c97e82524e
3 changed files with 13 additions and 12 deletions

View File

@ -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);

View File

@ -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);
}

View File

@ -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);
}