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:
Aofei Sheng
2024-08-15 18:40:17 +08:00
parent 4501519c4f
commit 8e66091dd2
7 changed files with 75 additions and 9 deletions

View File

@@ -51,7 +51,7 @@ func (p Program) tyPthreadCreate() *types.Signature {
}
func (b Builder) pthreadCreate(pp, attr, routine, arg Expr) Expr {
fn := b.Pkg.cFunc("pthread_create", b.Prog.tyPthreadCreate())
fn := b.Pkg.cFunc("llgoPthreadCreate", b.Prog.tyPthreadCreate())
return b.Call(fn, pp, attr, routine, arg)
}