diff --git a/src/sorted_queue.h b/src/sorted_queue.h index 70e521f..9647622 100644 --- a/src/sorted_queue.h +++ b/src/sorted_queue.h @@ -20,6 +20,7 @@ #include "fast_mblock.h" #include "fc_list.h" +#include "pthread_func.h" struct sorted_queue { @@ -115,6 +116,16 @@ static inline bool sorted_queue_empty(struct sorted_queue *sq) int sorted_queue_free_chain(struct sorted_queue *sq, struct fast_mblock_man *mblock, struct fc_list_head *head); +static inline void sorted_queue_lock(struct sorted_queue *sq) +{ + PTHREAD_MUTEX_LOCK(&sq->lcp.lock); +} + +static inline void sorted_queue_unlock(struct sorted_queue *sq) +{ + PTHREAD_MUTEX_UNLOCK(&sq->lcp.lock); +} + #ifdef __cplusplus } #endif