Files
c_soft/soft/mythread.h

35 lines
463 B
C
Raw Permalink Normal View History

2024-06-18 19:37:43 +08:00
#ifndef mythread_h__
#define mythread_h__
#include "pthread.h"
#include "exception.h"
2025-06-25 11:29:06 +08:00
#define FUNC_NAME_LEN 20
typedef struct _myth_def{
struct _myth_def *next;
struct _myth_def *last;
pthread_t th;
exception_def except;
size_t id;
size_t end;
int (*func)(void *);
2025-06-25 11:29:06 +08:00
void* arg;
char name[FUNC_NAME_LEN];
}myth_def;
2024-06-18 19:37:43 +08:00
2025-06-25 11:29:06 +08:00
pthread_t* myth_create(int (*func)(void *t),void *t,const char *name);
2024-06-18 19:37:43 +08:00
int myth_join();
myth_def *myth_self();
2024-06-18 19:37:43 +08:00
#endif