diff --git a/osal/alcore/mbuf.c b/osal/alcore/mbuf.c index 0cc8054..f540bf9 100644 --- a/osal/alcore/mbuf.c +++ b/osal/alcore/mbuf.c @@ -55,7 +55,7 @@ #define LOG_TAG "MBUF" #include #define MBUF_ERR(...) ALOGE(__VA_ARGS__) -#define MBUF_DBG(...) //ALOGD(## __VA_ARGS__) +#define MBUF_DBG(...) ALOGD(__VA_ARGS__) #else #define MBUF_ERR(...) printf( __VA_ARGS__) #define MBUF_DBG(...) //printf( __VA_ARGS__) @@ -242,9 +242,9 @@ static void *socket_func(void * arg) if (timeout_flag == 0 && num == 0) pthread_cond_wait(&thread->cond, &thread->mutex); - if (thread->exit_flag == 1) { - MBUF_DBG("%s line:%d will exit\n", - __func__, __LINE__); + if (thread->exit_flag == 1 || timeout_flag > 2) { + MBUF_DBG("%s line:%d will exit (%d)\n", + __func__, __LINE__, timeout_flag); if (fds != NULL) free(fds); pthread_mutex_unlock(&thread->mutex); @@ -289,9 +289,9 @@ static void *socket_func(void * arg) __LINE__, errno, strerror(errno)); assert(0); } else if (ret == 0) { - MBUF_DBG("%s line:%d poll time out\n", - __func__, __LINE__); - timeout_flag = 1; + MBUF_DBG("%s line:%d poll time out %dth\n", + __func__, __LINE__, timeout_flag); + timeout_flag++; continue; } else { MBUF_DBG("%s line:%d poll ok [%d]\n",