aboutsummaryrefslogtreecommitdiff
path: root/stdlib/threads.c
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/threads.c')
-rw-r--r--stdlib/threads.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/stdlib/threads.c b/stdlib/threads.c
index efd23546..9ad68c81 100644
--- a/stdlib/threads.c
+++ b/stdlib/threads.c
@@ -33,7 +33,7 @@ static void *run_thread(Closure_t *closure)
public Thread_t Thread$new(Closure_t fn)
{
- Thread_t thread = new(pthread_t);
+ Thread_t thread = GC_MALLOC(sizeof(pthread_t));
Closure_t *closure = new(Closure_t, .fn=fn.fn, .userdata=fn.userdata);
pthread_create(thread, NULL, (void*)run_thread, closure);
return thread;