1
0
mirror of https://github.com/fumiama/simple-dict.git synced 2026-06-21 03:10:56 +08:00

优化代码结构

This commit is contained in:
源文雨
2022-05-15 13:34:53 +08:00
parent 85a6d32cf9
commit 46e80af181
7 changed files with 50 additions and 31 deletions

2
dict.h
View File

@@ -106,7 +106,7 @@ static inline FILE* open_dict(uint32_t index, int isro) {
}
static inline int require_shared_lock() {
if(pthread_rwlock_tryrdlock(&mu)) {
if(pthread_rwlock_rdlock(&mu)) {
perror("Open dict: Readlock busy");
return 1;
}