Skip to content

Commit

Permalink
Add check to confirm there're no pending operations before key return…
Browse files Browse the repository at this point in the history
… to free list
  • Loading branch information
jimying committed Nov 21, 2024
1 parent 1b2fe0b commit cfe33e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pjlib/src/pj/ioqueue_winnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion pjlib/src/pj/os_core_win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

/*
Expand Down

0 comments on commit cfe33e9

Please sign in to comment.