MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / register_fork_handler

Function register_fork_handler

pt.c:66–82  ·  view source on GitHub ↗

Register handlers to be invoked after internal_fork() * to do various per-subsystem setup / cleanup tasks. * Takes a reference to a "stable" structure (i.e. static or * malloc'ed) which has to be alive until the last internal_fork() * is called. */

Source from the content-addressed store, hash-verified

64 * malloc'ed) which has to be alive until the last internal_fork()
65 * is called. */
66void register_fork_handler(struct internal_fork_handler *h)
67{
68 struct internal_fork_handler *hp;
69
70 if (is_main == 0) {
71 LM_BUG("buggy call from non-main process!!!\n");
72 abort();
73 }
74 if (h->_next != NULL) {
75 LM_BUG("buggy call h->_next != NULL!!!\n");
76 abort();
77 }
78
79 for (hp = _fork_handlers; hp->_next != NULL; hp = hp->_next)
80 continue;
81 hp->_next = h;
82};
83
84static unsigned long count_running_processes(void *x)
85{

Callers 1

main_loopFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected