From 0e1a4576b47e3da6ba552972574faa41c998b051 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Wed, 23 Sep 2020 18:02:15 +0800 Subject: [PATCH] for debug --- src/tsdb/src/tsdbBuffer.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/tsdb/src/tsdbBuffer.c b/src/tsdb/src/tsdbBuffer.c index 2e097c6ff7..e4795ad1ff 100644 --- a/src/tsdb/src/tsdbBuffer.c +++ b/src/tsdb/src/tsdbBuffer.c @@ -121,7 +121,16 @@ SListNode *tsdbAllocBufBlockFromPool(STsdbRepo *pRepo) { while (POOL_IS_EMPTY(pBufPool)) { pRepo->repoLocked = false; +#ifndef NDEBUG + struct timespec abstime = {0, 0}; + clock_gettime(CLOCK_REALTIME, &abstime); + abstime.tv_sec += (60 * 15); + if (pthread_cond_timedwait(&(pBufPool->poolNotEmpty), &(pRepo->mutex), &abstime) != 0) { + assert(0); + } +#else pthread_cond_wait(&(pBufPool->poolNotEmpty), &(pRepo->mutex)); +#endif pRepo->repoLocked = true; } -- GitLab