| 619 | } |
| 620 | |
| 621 | static void main_fiber_monitor_used(ACL_FIBER *fiber, void *ctx acl_unused) |
| 622 | { |
| 623 | if (acl_var_fiber_use_limit <= 0) { |
| 624 | acl_msg_warn("%s(%d), %s: invalid fiber_use_limit(%d)", |
| 625 | __FILE__, __LINE__, __FUNCTION__, |
| 626 | acl_var_fiber_use_limit); |
| 627 | return; |
| 628 | } |
| 629 | |
| 630 | while (1) { |
| 631 | if (acl_atomic_clock_users(__clock) > 0) { |
| 632 | acl_fiber_sleep(1); |
| 633 | continue; |
| 634 | } |
| 635 | |
| 636 | if (acl_atomic_clock_count(__clock) >= |
| 637 | (unsigned) acl_var_fiber_use_limit) { |
| 638 | break; |
| 639 | } |
| 640 | |
| 641 | acl_fiber_sleep(1); |
| 642 | } |
| 643 | |
| 644 | acl_msg_info("%s(%d), %s: use_limit reached %d", |
| 645 | __FILE__, __LINE__, __FUNCTION__, acl_var_fiber_use_limit); |
| 646 | |
| 647 | main_stop_listen(); |
| 648 | main_server_onexit(); |
| 649 | main_stop_servers(); |
| 650 | main_free_servers(); |
| 651 | |
| 652 | main_server_exit(fiber, 0); |
| 653 | } |
| 654 | |
| 655 | static void main_fiber_monitor_idle(ACL_FIBER *fiber, void *ctx acl_unused) |
| 656 | { |
nothing calls this directly
no test coverage detected
searching dependent graphs…