add functions sorted_queue_lock and sorted_queue_unlock
parent
7726d0223f
commit
643ecdc906
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
#include "fast_mblock.h"
|
#include "fast_mblock.h"
|
||||||
#include "fc_list.h"
|
#include "fc_list.h"
|
||||||
|
#include "pthread_func.h"
|
||||||
|
|
||||||
struct sorted_queue
|
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,
|
int sorted_queue_free_chain(struct sorted_queue *sq,
|
||||||
struct fast_mblock_man *mblock, struct fc_list_head *head);
|
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
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue