add struct SFSynchronizeContext
parent
e35a3ca104
commit
1901189515
|
|
@ -18,7 +18,7 @@
|
||||||
#ifndef _SF_FUNC_H
|
#ifndef _SF_FUNC_H
|
||||||
#define _SF_FUNC_H
|
#define _SF_FUNC_H
|
||||||
|
|
||||||
#include "fastcommon/common_define.h"
|
#include "fastcommon/pthread_func.h"
|
||||||
#include "sf_types.h"
|
#include "sf_types.h"
|
||||||
#include "sf_global.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
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -235,4 +235,12 @@ typedef struct sf_cluster_config {
|
||||||
int service_group_index;
|
int service_group_index;
|
||||||
} SFClusterConfig;
|
} SFClusterConfig;
|
||||||
|
|
||||||
|
typedef struct sf_synchronize_context {
|
||||||
|
pthread_lock_cond_pair_t lcp;
|
||||||
|
union {
|
||||||
|
bool done;
|
||||||
|
int result;
|
||||||
|
};
|
||||||
|
} SFSynchronizeContext;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue