cosmopolitan/libc/thread/thread.h

34 lines
1,013 B
C
Raw Normal View History

#ifndef COSMOPOLITAN_LIBC_THREAD_THREAD_H_
#define COSMOPOLITAN_LIBC_THREAD_THREAD_H_
2022-06-22 13:37:45 +00:00
#include "libc/intrin/pthread.h"
#include "libc/runtime/runtime.h"
2022-08-13 15:42:32 +00:00
#include "libc/str/locale.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
2022-09-09 11:07:08 +00:00
struct Ftrace { /* 16 */
2022-07-11 15:04:58 +00:00
bool once; /* 0 */
bool noreentry; /* 1 */
int skew; /* 4 */
int64_t lastaddr; /* 8 */
};
struct cthread_descriptor_t {
struct cthread_descriptor_t *self; /* 0x00 */
2022-09-09 11:07:08 +00:00
struct Ftrace ftrace; /* 0x08 */
void *garbages; /* 0x18 */
2022-08-06 16:56:17 +00:00
locale_t locale; /* 0x20 */
2022-09-05 15:26:03 +00:00
pthread_t pthread; /* 0x28 */
struct cthread_descriptor_t *self2; /* 0x30 */
int32_t tid; /* 0x38 */
int32_t err; /* 0x3c */
};
typedef struct cthread_descriptor_t *cthread_t;
void cthread_ungarbage(void);
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_THREAD_THREAD_H_ */