reset throttle timer for each work item

This commit is contained in:
Yatao Li 2022-01-28 02:33:19 +08:00
parent 68252b4e80
commit 9a6e7c7c47

View File

@ -173,6 +173,7 @@ static void *tpool_worker(void *arg) {
if (work != NULL) {
stuck_notified = 0;
throttle_ms = 0;
while(!pool->stop && pool->mem_limit > 0 && _get_total_mem(pool) >= pool->mem_limit) {
if (!stuck_notified && throttle_ms >= 90000) {
// notify the pool that this thread is stuck.