gc: fix missing pthread registration causing unknown thread error
- Use `GC_pthread_create` instead of `pthread_create` when GC is enabled.
This commit is contained in:
11
c/pthread/_pthread/pthread_gc.c
Normal file
11
c/pthread/_pthread/pthread_gc.c
Normal file
@@ -0,0 +1,11 @@
|
||||
#define GC_THREADS
|
||||
#include <gc.h>
|
||||
#include <pthread.h>
|
||||
|
||||
int llgoPthreadCreate(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)(void *), void *arg) {
|
||||
return GC_pthread_create(thread, attr, start_routine, arg);
|
||||
}
|
||||
|
||||
int llgoPthreadJoin(pthread_t thread, void **retval) {
|
||||
return GC_pthread_join(thread, retval);
|
||||
}
|
||||
9
c/pthread/_pthread/pthread_nogc.c
Normal file
9
c/pthread/_pthread/pthread_nogc.c
Normal file
@@ -0,0 +1,9 @@
|
||||
#include <pthread.h>
|
||||
|
||||
int llgoPthreadCreate(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)(void *), void *arg) {
|
||||
return pthread_create(thread, attr, start_routine, arg);
|
||||
}
|
||||
|
||||
int llgoPthreadJoin(pthread_t thread, void **retval) {
|
||||
return pthread_join(thread, retval);
|
||||
}
|
||||
Reference in New Issue
Block a user