MCPcopy Create free account
hub / github.com/acl-dev/acl / main_fiber_monitor_used

Function main_fiber_monitor_used

lib_fiber/cpp/src/fiber_server.cpp:621–653  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

619}
620
621static 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
655static void main_fiber_monitor_idle(ACL_FIBER *fiber, void *ctx acl_unused)
656{

Callers

nothing calls this directly

Calls 10

acl_msg_warnFunction · 0.85
acl_atomic_clock_usersFunction · 0.85
acl_atomic_clock_countFunction · 0.85
acl_msg_infoFunction · 0.85
main_stop_listenFunction · 0.85
main_server_onexitFunction · 0.85
main_stop_serversFunction · 0.85
main_free_serversFunction · 0.85
main_server_exitFunction · 0.70
acl_fiber_sleepFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…