From cfe33e9fddb7fff2d04dc3ab4986d041229f7db0 Mon Sep 17 00:00:00 2001 From: jimying Date: Thu, 21 Nov 2024 22:23:13 +0800 Subject: [PATCH] Add check to confirm there're no pending operations before key return to free list --- pjlib/src/pj/ioqueue_winnt.c | 3 +++ pjlib/src/pj/os_core_win32.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pjlib/src/pj/ioqueue_winnt.c b/pjlib/src/pj/ioqueue_winnt.c index 58f2d0f27c..c0a612289c 100644 --- a/pjlib/src/pj/ioqueue_winnt.c +++ b/pjlib/src/pj/ioqueue_winnt.c @@ -1042,6 +1042,9 @@ static void scan_closing_keys(pj_ioqueue_t *ioqueue) pj_assert(key->closing != 0); if (PJ_TIME_VAL_GTE(now, key->free_time)) { + /* Confirm that there're no any pending operations */ + pj_assert(pj_list_empty(&key->pending_list)); + pj_list_erase(key); pj_list_push_back(&ioqueue->free_list, key); } diff --git a/pjlib/src/pj/os_core_win32.c b/pjlib/src/pj/os_core_win32.c index 4eb8c00fd1..4941027bdf 100644 --- a/pjlib/src/pj/os_core_win32.c +++ b/pjlib/src/pj/os_core_win32.c @@ -54,7 +54,7 @@ #else # define LOG_MUTEX(expr) PJ_LOG(6,expr) #endif -# define LOG_MUTEX_WARN(expr) PJ_LOG(3,expr) +# define LOG_MUTEX_WARN(expr) PJ_PERROR(3,expr) #define THIS_FILE "os_core_win32.c" /*