mirror of
https://github.com/fumiama/simple-dict.git
synced 2026-06-30 00:40:25 +08:00
優化
This commit is contained in:
22
tcpool.h
22
tcpool.h
@@ -22,6 +22,18 @@
|
|||||||
#define TCPOOL_THREAD_TIMER_T_SZ 1024
|
#define TCPOOL_THREAD_TIMER_T_SZ 1024
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define TCPOOL_THREAD_TIMER_T_HEAD_SZ ( \
|
||||||
|
sizeof(uint32_t) \
|
||||||
|
+sizeof(int) \
|
||||||
|
+sizeof(time_t) \
|
||||||
|
+sizeof(pthread_rwlock_t) \
|
||||||
|
+2*sizeof(pthread_t) \
|
||||||
|
+2*sizeof(pthread_cond_t) \
|
||||||
|
+2*sizeof(pthread_mutex_t) \
|
||||||
|
+sizeof(pthread_rwlock_t) \
|
||||||
|
+2*sizeof(uint8_t) \
|
||||||
|
)
|
||||||
|
|
||||||
#ifndef TCPOOL_THREADCNT
|
#ifndef TCPOOL_THREADCNT
|
||||||
#define TCPOOL_THREADCNT 32
|
#define TCPOOL_THREADCNT 32
|
||||||
#endif
|
#endif
|
||||||
@@ -33,15 +45,7 @@
|
|||||||
#ifndef TCPOOL_THREAD_CONTEXT
|
#ifndef TCPOOL_THREAD_CONTEXT
|
||||||
#define TCPOOL_THREAD_CONTEXT uint8_t __padding[ \
|
#define TCPOOL_THREAD_CONTEXT uint8_t __padding[ \
|
||||||
TCPOOL_THREAD_TIMER_T_SZ \
|
TCPOOL_THREAD_TIMER_T_SZ \
|
||||||
-sizeof(uint32_t) \
|
-TCPOOL_THREAD_TIMER_T_HEAD_SZ \
|
||||||
-sizeof(int) \
|
|
||||||
-sizeof(time_t) \
|
|
||||||
-sizeof(pthread_rwlock_t) \
|
|
||||||
-2*sizeof(pthread_t) \
|
|
||||||
-2*sizeof(pthread_cond_t) \
|
|
||||||
-2*sizeof(pthread_mutex_t) \
|
|
||||||
-sizeof(pthread_rwlock_t) \
|
|
||||||
-2*sizeof(uint8_t) \
|
|
||||||
]
|
]
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user