Skip to content

Commit 93662d1

Browse files
authored
Update thread.c
1 parent 60dc0fa commit 93662d1

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

src/win/thread.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ static
2020
DWORD
2121
WINAPI
2222
thread_entry(void *arg) {
23-
tm_thread_entry entry;
24-
25-
/* to call free before calling thread func */
26-
memcpy(&entry, arg, sizeof(entry));
27-
free(arg);
28-
29-
entry.func(entry.arg);
30-
23+
tm_thread_entry entry;
24+
25+
/* to call free before calling thread func */
26+
memcpy(&entry, arg, sizeof(entry));
27+
free(arg);
28+
29+
entry.func(entry.arg);
30+
3131
return 0;
3232
}
3333

@@ -37,17 +37,17 @@ thread_new(void (*func)(void *), void *obj) {
3737
tm_allocator *alc;
3838
tm_thread *th;
3939
tm_thread_entry *entry;
40-
41-
42-
alc = tm_get_allocator();
43-
th = alc->calloc(1, sizeof(*th));
44-
entry = calloc(1, sizeof(*entry));
45-
entry->func = func;
40+
41+
42+
alc = tm_get_allocator();
43+
th = alc->calloc(1, sizeof(*th));
44+
entry = calloc(1, sizeof(*entry));
45+
entry->func = func;
4646
entry->arg = obj;
4747

48-
th->id = CreateThread(NULL, 0, thread_entry, entry, 0, NULL);
48+
th->id = CreateThread(NULL, 0, thread_entry, entry, 0, NULL);
4949

50-
return th;
50+
return th;
5151
}
5252

5353
TM_HIDE

0 commit comments

Comments
 (0)