1
0
mirror of https://github.com/fumiama/simple-dict.git synced 2026-06-23 20:50:27 +08:00

fix: mutex

This commit is contained in:
源文雨
2022-04-10 15:14:32 +08:00
parent 5084f796a9
commit 465afde645
3 changed files with 46 additions and 45 deletions

14
dict.h
View File

@@ -16,13 +16,13 @@ typedef struct DICT DICT;
#define DICT_LOCK_SH 0x01
#define DICT_LOCK_EX 0x02
int init_dict(char* file_path);
void close_dict(uint8_t lock_type, uint32_t index);
int fill_md5();
FILE* get_dict_fp_wr();
off_t get_dict_size();
void close_dict(uint8_t lock_type, uint32_t index, pthread_rwlock_t* mu);
int fill_md5(pthread_rwlock_t* mu);
int init_dict(char* file_path, pthread_rwlock_t* mu);
int is_md5_equal(uint8_t* digest);
FILE* get_dict_fp_rd();
int is_md5_equal(uint8_t* digest);
FILE *open_dict(uint8_t lock_type, uint32_t index);
FILE* get_dict_fp_wr();
off_t get_dict_size(pthread_rwlock_t* mu);
FILE* open_dict(uint8_t lock_type, uint32_t index, pthread_rwlock_t* mu);
#endif