add struct SFSynchronizeContext

storage_engine
YuQing 2021-10-05 20:03:05 +08:00
parent e35a3ca104
commit 1901189515
2 changed files with 14 additions and 1 deletions

View File

@ -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

View File

@ -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