优化退出流程,统一注册到on_exit(
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
#define LOG
|
||||
|
||||
#include <semaphore.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#define MAX_LOG 256
|
||||
|
||||
@ -16,12 +17,17 @@ typedef struct log_manager
|
||||
int (*in_log)(logs *,struct log_manager*);
|
||||
logs* (*out_log)(struct log_manager*);
|
||||
void *(*clear_log)(void*);
|
||||
int (*cleanup)(struct log_manager*);
|
||||
sem_t log_sem;
|
||||
logs *log;
|
||||
logs *rear;
|
||||
int count;
|
||||
pthread_mutex_t mtx;
|
||||
pthread_cond_t cond;
|
||||
int stop;
|
||||
}log_manager;
|
||||
|
||||
void log_manager_stop(log_manager *self);
|
||||
int init_loger(log_manager *self);
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user