lib: c: add pthread implementation
This commit is contained in:
25
lib/libc/pthread/include/pthread.h
Normal file
25
lib/libc/pthread/include/pthread.h
Normal 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
|
||||
Reference in New Issue
Block a user