diff --git a/src/sf_func.h b/src/sf_func.h index 1431c84..8f64738 100644 --- a/src/sf_func.h +++ b/src/sf_func.h @@ -18,7 +18,7 @@ #ifndef _SF_FUNC_H #define _SF_FUNC_H -#include "fastcommon/common_define.h" +#include "fastcommon/pthread_func.h" #include "sf_types.h" #include "sf_global.h" @@ -69,6 +69,11 @@ static inline void sf_binlog_buffer_destroy(SFBinlogBuffer *buffer) } } +static inline int sf_synchronize_ctx_init(SFSynchronizeContext *sctx) +{ + return init_pthread_lock_cond_pair(&sctx->lcp); +} + #ifdef __cplusplus } #endif diff --git a/src/sf_types.h b/src/sf_types.h index 69d37e3..9d1a489 100644 --- a/src/sf_types.h +++ b/src/sf_types.h @@ -235,4 +235,12 @@ typedef struct sf_cluster_config { int service_group_index; } SFClusterConfig; +typedef struct sf_synchronize_context { + pthread_lock_cond_pair_t lcp; + union { + bool done; + int result; + }; +} SFSynchronizeContext; + #endif