lib: c: add pthread implementation

This commit is contained in:
2026-03-18 21:08:49 +00:00
parent 342b588b38
commit cf70352caa
13 changed files with 309 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
#ifndef PTHREAD_H_
#define PTHREAD_H_
#define __PTHREAD_ATTR_SIZE__ 32
typedef struct __pthread *pthread_t;
typedef struct __pthread_attr {
long __sig;
char __opaque[__PTHREAD_ATTR_SIZE__];
} pthread_attr_t;
extern int __pthread_init(void);
extern int pthread_create(
pthread_t *thread,
const pthread_attr_t *attr,
void *(*start_func)(void *),
void *arg);
extern pthread_t pthread_self(void);
extern int pthread_join(pthread_t thread, void **retval);
extern int pthread_detach(pthread_t thread);
extern void pthread_exit(void *retval);
#endif