diff --git a/src/idempotency/client/client_channel.h b/src/idempotency/client/client_channel.h index a48d23e..59bc3ed 100644 --- a/src/idempotency/client/client_channel.h +++ b/src/idempotency/client/client_channel.h @@ -74,20 +74,12 @@ static inline void idempotency_client_channel_set_id_key( static inline int idempotency_client_channel_check_wait_ex( struct idempotency_client_channel *channel, const int timeout) { - struct timespec ts; - if (__sync_add_and_fetch(&channel->established, 0)) { return 0; } idempotency_client_channel_check_reconnect(channel); - PTHREAD_MUTEX_LOCK(&channel->lc_pair.lock); - ts.tv_sec = get_current_time() + timeout; - ts.tv_nsec = 0; - pthread_cond_timedwait(&channel->lc_pair.cond, - &channel->lc_pair.lock, &ts); - PTHREAD_MUTEX_UNLOCK(&channel->lc_pair.lock); - + lcp_timedwait_sec(&channel->lc_pair, timeout); return __sync_add_and_fetch(&channel->established, 0) ? 0 : ETIMEDOUT; } diff --git a/src/sf_binlog_writer.h b/src/sf_binlog_writer.h index bef3283..faf1671 100644 --- a/src/sf_binlog_writer.h +++ b/src/sf_binlog_writer.h @@ -60,7 +60,7 @@ typedef struct sf_binlog_writer_buffer_ring { typedef struct binlog_writer_thread { struct fast_mblock_man mblock; struct fc_queue queue; - volatile bool running; + bool running; bool use_fixed_buffer_size; short order_mode; short order_by;