diff --git a/event.c b/event.c index bfeab2cf..61089fb7 100644 --- a/event.c +++ b/event.c @@ -145,6 +145,8 @@ int event_queue_add_file_monitor(int eq, char *filename, int *id) { } *id = fd; + + uwsgi_log("added new file to monitor %s\n", filename); return fd; } @@ -154,14 +156,14 @@ struct uwsgi_fmon *event_queue_ack_file_monitor(int id, void hook(char *, uint32 int i; struct uwsgi_fmon *uf = NULL; - for(i=0;ifiles_monitored_cnt;i++) { + if (uwsgi.shared->files_monitored[i].registered) { + if (uwsgi.shared->files_monitored[i].fd == id) { if (hook) { - hook(uwsgi.files_monitored[i].filename, 0, NULL); + hook(uwsgi.shared->files_monitored[i].filename, 0, NULL); } else { - uf = &uwsgi.files_monitored[i]; + uf = &uwsgi.shared->files_monitored[i]; } } } @@ -371,10 +373,10 @@ struct uwsgi_timer *event_queue_ack_timer(int id, void hook(int ,int)) { int i; struct uwsgi_timer *ut = NULL; - for(i=0;itimers_cnt;i++) { + if (uwsgi.shared->timers[i].registered) { + if (uwsgi.shared->timers[i].id == id) { + ut = &uwsgi.shared->timers[i]; } } } diff --git a/lock.c b/lock.c index 26f744ee..e75fcfce 100644 --- a/lock.c +++ b/lock.c @@ -3,6 +3,8 @@ #ifdef UWSGI_LOCK_USE_MUTEX +#define UWSGI_LOCK_SIZE sizeof(pthread_mutexattr_t) + sizeof(pthread_mutex_t) + // REMEMBER lock must contains space for both pthread_mutex_t and pthread_mutexattr_t !!! void uwsgi_lock_init(void *lock) { @@ -41,6 +43,8 @@ void uwsgi_unlock(void *lock) { #include #include +#define UWSGI_LOCK_SIZE sizeof(struct umtx) + void uwsgi_lock_init(void *lock) { umtx_init((struct umtx*) lock); } @@ -58,6 +62,8 @@ void uwsgi_unlock(void *lock) { #ifdef UWSGI_LOCK_USE_OSX_SPINLOCK +#define UWSGI_LOCK_SIZE sizeof(OSSpinLock) + void uwsgi_lock_init(void *lock) { memset(lock, 0, sizeof(OSSpinLock)); @@ -90,3 +96,16 @@ void uwsgi_unlock(void *lock) { } #endif + + +void *uwsgi_mmap_shared_lock() { + void *addr = NULL; + addr = mmap(NULL, UWSGI_LOCK_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0); + + if (addr == NULL) { + uwsgi_error("mmap()"); + exit(1); + } + + return addr; +} diff --git a/master.c b/master.c index e8c8e3ac..4d76ec20 100644 --- a/master.c +++ b/master.c @@ -61,7 +61,7 @@ void master_loop(char **argv, char **environ) { int master_has_children = 0; - char uwsgi_signal; + uint8_t uwsgi_signal; #ifdef UWSGI_UDP struct pollfd uwsgi_poll[2]; @@ -81,7 +81,7 @@ void master_loop(char **argv, char **environ) { #endif #endif - int i,j; + int i=0,j; int rlen; int check_interval = 1; @@ -100,10 +100,8 @@ void master_loop(char **argv, char **environ) { uwsgi.master_queue = event_queue_init(); - for(i=1;i<=uwsgi.numproc;i++) { - uwsgi_log("adding %d to signal poll\n", uwsgi.workers[i].pipe[0]); - event_queue_add_fd_read(uwsgi.master_queue, uwsgi.workers[i].pipe[0]); - } + uwsgi_log("adding %d to signal poll\n", uwsgi.shared->worker_signal_pipe[0]); + event_queue_add_fd_read(uwsgi.master_queue, uwsgi.shared->worker_signal_pipe[0]); uwsgi.wsgi_req->buffer = uwsgi.async_buf[0]; #ifdef UWSGI_UDP @@ -196,13 +194,7 @@ void master_loop(char **argv, char **environ) { #endif - // add unregistered file monitors - for(i=0;i= uwsgi.numproc && uwsgi.to_hell) { @@ -315,6 +309,17 @@ void master_loop(char **argv, char **environ) { if (!check_interval) check_interval = 1; + + // add unregistered file monitors + uwsgi_lock(uwsgi.fmon_table_lock); + for(i=0;ifiles_monitored_cnt;i++) { + if (!ushared->files_monitored[i].registered) { + ushared->files_monitored[i].fd = event_queue_add_file_monitor(uwsgi.master_queue, ushared->files_monitored[i].filename, &ushared->files_monitored[i].id); + ushared->files_monitored[i].registered = 1; + } + } + uwsgi_unlock(uwsgi.fmon_table_lock); + int interesting_fd = -1; rlen = event_queue_wait(uwsgi.master_queue, check_interval, &interesting_fd); @@ -410,20 +415,29 @@ void master_loop(char **argv, char **environ) { int next_iteration = 0; - for(i=0;ifiles_monitored_cnt;i++) { + if (ushared->files_monitored[i].registered) { + if (interesting_fd == ushared->files_monitored[i].fd) { struct uwsgi_fmon *uf = event_queue_ack_file_monitor(interesting_fd, NULL); // now call the file_monitor handler if (uf) { - uwsgi_log("fd event for %s\n", uf->filename); + uwsgi_log("fd event for %s (signal %d)\n", uf->filename, uf->sig); + + struct uwsgi_signal_entry *use = &ushared->signal_table[uf->sig]; + if (use->kind == SIGNAL_KIND_WORKER) { + uwsgi_log("write signal returned %d\n", write(ushared->worker_signal_pipe[0], &uf->sig, 1)); + } } break; } } } + + uwsgi_unlock(uwsgi.fmon_table_lock); if (next_iteration) continue; + /* next_iteration = 0; for(i=0;i 0) { - uwsgi_log("received uwsgi signal %d from worker %d\n", uwsgi_signal, i); - } - else { - uwsgi_log_verbose("lost connection with worker %d\n", i); - close(interesting_fd); - uwsgi.workers[i].pipe[0] = -1; + // check for worker signal + if (interesting_fd == uwsgi.shared->worker_signal_pipe[0]) { + rlen = read(interesting_fd, &uwsgi_signal, 1); + if (rlen < 0) { + uwsgi_error("read()"); + } + else if (rlen > 0) { + uwsgi_log("received uwsgi signal %d from workers\n", uwsgi_signal); + // use uwsgi_route_signal() + struct uwsgi_signal_entry *use = &uwsgi.shared->signal_table[uwsgi_signal]; + if (use->kind == SIGNAL_KIND_WORKER) { + uwsgi_log("write signal returned %d\n", write(uwsgi.shared->worker_signal_pipe[0], &uwsgi_signal, 1)); } } + else { + uwsgi_log_verbose("lost connection with worker %d\n", i); + close(interesting_fd); + //uwsgi.workers[i].pipe[0] = -1; + } } } @@ -660,15 +678,17 @@ void master_loop(char **argv, char **environ) { gettimeofday(&last_respawn, NULL); uwsgi.respawn_delta = last_respawn.tv_sec; // close the communication pipe + /* close(uwsgi.workers[uwsgi.mywid].pipe[0]); if (socketpair(AF_UNIX, SOCK_STREAM, 0, uwsgi.workers[uwsgi.mywid].pipe)) { uwsgi_error("socketpair()\n"); continue; } + */ pid = fork(); if (pid == 0) { // fix the communication pipe - close(uwsgi.workers[uwsgi.mywid].pipe[0]); + close(uwsgi.shared->worker_signal_pipe[1]); uwsgi.mypid = getpid(); uwsgi.workers[uwsgi.mywid].pid = uwsgi.mypid; uwsgi.workers[uwsgi.mywid].harakiri = 0; @@ -684,8 +704,8 @@ void master_loop(char **argv, char **environ) { } else { uwsgi_log( "Respawned uWSGI worker (new pid: %d)\n", pid); - close(uwsgi.workers[uwsgi.mywid].pipe[1]); - event_queue_add_fd_read(uwsgi.master_queue, uwsgi.workers[uwsgi.mywid].pipe[0]); + //close(uwsgi.workers[uwsgi.mywid].pipe[1]); + //event_queue_add_fd_read(uwsgi.master_queue, uwsgi.workers[uwsgi.mywid].pipe[0]); #ifdef UWSGI_SPOOLER if (uwsgi.mywid <= 0 && diedpid != uwsgi.shared->spooler_pid) { #else diff --git a/plugins/python/python_plugin.c b/plugins/python/python_plugin.c index 6edee9db..3e72a922 100644 --- a/plugins/python/python_plugin.c +++ b/plugins/python/python_plugin.c @@ -827,6 +827,25 @@ void uwsgi_python_suspend(struct wsgi_request *wsgi_req) { } +int uwsgi_python_signal_handler(uint8_t sig, void *handler, char *payload, uint8_t payload_size) { + + PyObject *args = PyTuple_New(2); + PyObject *ret; + + if (!args) return -1; + + PyTuple_SetItem(args, 0, PyInt_FromLong(sig)); + PyTuple_SetItem(args, 1, PyString_FromStringAndSize(payload, payload_size)); + + ret = python_call(handler, args, 0); + + if (ret) { + return 0; + } + + return -1; +} + void uwsgi_python_resume(struct wsgi_request *wsgi_req) { PyThreadState* tstate = PyThreadState_GET(); @@ -857,6 +876,8 @@ void uwsgi_python_resume(struct wsgi_request *wsgi_req) { .suspend = uwsgi_python_suspend, .resume = uwsgi_python_resume, + + .signal_handler = uwsgi_python_signal_handler, //.spooler = uwsgi_python_spooler, /* .help = uwsgi_python_help, diff --git a/plugins/python/uwsgi_pymodule.c b/plugins/python/uwsgi_pymodule.c index 1f22ee7b..90ce04bc 100644 --- a/plugins/python/uwsgi_pymodule.c +++ b/plugins/python/uwsgi_pymodule.c @@ -155,43 +155,64 @@ PyObject *py_uwsgi_close(PyObject * self, PyObject * args) { } -PyObject *py_uwsgi_signal(PyObject * self, PyObject * args) { +PyObject *py_uwsgi_register_file_monitor(PyObject * self, PyObject * args) { - char uwsgi_signal; - ssize_t rlen; - char *payload = NULL; - struct uwsgi_header uh; + uint8_t uwsgi_signal; + uint8_t signal_kind; + PyObject *handler; + char *filename; - if (!PyArg_ParseTuple(args, "B|s:signal", &uwsgi_signal, &payload)) { + if (!PyArg_ParseTuple(args, "BsBO:register_file_monitor", &uwsgi_signal, &filename, &signal_kind, &handler)) { return NULL; } - // am i the master ? - if (uwsgi.mywid == 0) { - register_signal(uwsgi_signal, payload); - goto done; - } + uwsgi_log("signal_kind %d\n", signal_kind); - uwsgi_log("sending %d to master\n", uwsgi_signal); - uh.modifier1 = 110; - if (payload) { - uh.pktsize = strlen(payload); + uwsgi_register_file_monitor(uwsgi_signal, filename, signal_kind, handler, 0); + + Py_INCREF(Py_None); + return Py_None; +} + +PyObject *py_uwsgi_register_signal(PyObject * self, PyObject * args) { + + uint8_t uwsgi_signal; + uint8_t signal_kind; + PyObject *handler; + char *payload = NULL; + + if (!PyArg_ParseTuple(args, "BBO|s:register_signal", &uwsgi_signal, &signal_kind, &handler, &payload)) { + return NULL; + } + + uwsgi_log("REGISTER SIGNAL %d\n", uwsgi_signal); + if (payload == NULL) { + uwsgi_register_signal(uwsgi_signal, signal_kind, handler, 0, NULL, 0); } else { - uh.pktsize = 0; + uwsgi_register_signal(uwsgi_signal, signal_kind, handler, 0, payload, strlen(payload)); } - uh.modifier2 = uwsgi_signal; + + Py_INCREF(Py_None); + return Py_None; +} + +PyObject *py_uwsgi_signal(PyObject * self, PyObject * args) { + + uint8_t uwsgi_signal; + ssize_t rlen; + + if (!PyArg_ParseTuple(args, "B:signal", &uwsgi_signal)) { + return NULL; + } + + uwsgi_log("sending %d to master\n", uwsgi_signal); - rlen = write(uwsgi.workers[uwsgi.mywid].pipe[1], &uh, 4); - if (rlen == 4) { - if (uh.pktsize) { - if (write(uwsgi.workers[uwsgi.mywid].pipe[1], payload, uh.pktsize) < 0) { - uwsgi_error("write()"); - } - } + rlen = write(uwsgi.shared->worker_signal_pipe[1], &uwsgi_signal, 1); + if (rlen != 1) { + uwsgi_error("write()"); } -done: Py_INCREF(Py_None); return Py_None; @@ -1869,7 +1890,10 @@ static PyMethodDef uwsgi_advanced_methods[] = { {"send", py_uwsgi_send, METH_VARARGS, ""}, {"cl", py_uwsgi_cl, METH_VARARGS, ""}, + {"register_signal", py_uwsgi_register_signal, METH_VARARGS, ""}, {"signal", py_uwsgi_signal, METH_VARARGS, ""}, + {"register_file_monitor", py_uwsgi_register_file_monitor, METH_VARARGS, ""}, + //{"register_timer", py_uwsgi_register_timer, METH_VARARGS, ""}, #ifdef UWSGI_SENDFILE {"sendfile", py_uwsgi_advanced_sendfile, METH_VARARGS, ""}, #endif diff --git a/signal.c b/signal.c index e941416c..1d51f9d3 100644 --- a/signal.c +++ b/signal.c @@ -2,8 +2,40 @@ extern struct uwsgi_server uwsgi; -int register_signal(uint8_t sig, char *payload) { +int uwsgi_signal_handler(uint8_t sig) { + struct uwsgi_signal_entry *use = NULL; + + use = &uwsgi.shared->signal_table[sig]; + + if (!use->kind) { + return -1; + } + + if (!uwsgi.p[use->modifier1]->signal_handler) { + return -1; + } + + return uwsgi.p[use->modifier1]->signal_handler(sig, use->handler, use->payload, use->payload_size); +} + +void uwsgi_register_signal(uint8_t sig, uint8_t kind, void *handler, uint8_t modifier1, char *payload, uint8_t payload_size) { + + struct uwsgi_signal_entry *use = NULL; + + uwsgi_lock(uwsgi.signal_table_lock); + + use = &uwsgi.shared->signal_table[sig]; + + use->kind = kind; + use->handler = handler; + use->modifier1 = modifier1; + + memcpy(use->payload, payload, payload_size); + + use->payload_size = payload_size; + + /* switch(sig) { case 10: @@ -37,6 +69,37 @@ int register_signal(uint8_t sig, char *payload) { } break; } + */ + + uwsgi_log("registered signal %d\n", sig); + + uwsgi_unlock(uwsgi.signal_table_lock); + +} + + +void uwsgi_register_file_monitor(uint8_t sig, char *filename, uint8_t kind, void *handler, uint8_t modifier1) { + + if (strlen(filename) > (0xff-1)) { + uwsgi_log("uwsgi_register_file_monitor: invalid filename length\n"); + return; + } + + uwsgi_lock(uwsgi.fmon_table_lock); + + if (ushared->files_monitored_cnt < 64) { + + // fill the fmon table, the master will use it to add items to the event queue + memcpy(ushared->files_monitored[ushared->files_monitored_cnt].filename, filename, strlen(filename)); + ushared->files_monitored[ushared->files_monitored_cnt].registered = 0; + ushared->files_monitored[ushared->files_monitored_cnt].sig = sig; + ushared->files_monitored_cnt++; + uwsgi_register_signal(sig, kind, handler, modifier1, filename, strlen(filename)); + } + else { + uwsgi_log("you can register max 64 file monitors !!!\n"); + } + + uwsgi_unlock(uwsgi.fmon_table_lock); - return 0; } diff --git a/utils.c b/utils.c index 4be13cd2..65820392 100644 --- a/utils.c +++ b/utils.c @@ -470,13 +470,16 @@ polling: return -1; } - if (uwsgi.sockets_poll[uwsgi.sockets_cnt].revents && uwsgi.master_process) { + if (uwsgi.master_process && uwsgi.sockets_poll[uwsgi.sockets_cnt].revents) { if (read(uwsgi.sockets_poll[uwsgi.sockets_cnt].fd, &uwsgi_signal, 1) <= 0 && uwsgi.no_orphans) { uwsgi_log_verbose("uWSGI worker %d screams: UAAAAAAH my master died, i will follow him...\n", uwsgi.mywid); end_me(); } else { uwsgi_log_verbose("master sent signal %b to worker %d\n", uwsgi_signal, uwsgi.mywid); + if (uwsgi_signal_handler(uwsgi_signal)) { + uwsgi_log_verbose("error managing signal %b on worker %d\n", uwsgi_signal, uwsgi.mywid); + } } } diff --git a/uwsgi.c b/uwsgi.c index eb53ef47..042fcbb7 100644 --- a/uwsgi.c +++ b/uwsgi.c @@ -839,20 +839,27 @@ options_parsed: } } + // application generic lock uwsgi.user_lock = uwsgi_mmap_shared_lock(); - if (!uwsgi.user_lock) { - uwsgi_error("mmap()"); - exit(1); - } uwsgi_lock_init(uwsgi.user_lock); -#ifdef UWSGI_EMBEDDED + if (uwsgi.master_process) { + // signal table lock + uwsgi.signal_table_lock = uwsgi_mmap_shared_lock(); + uwsgi_lock_init(uwsgi.signal_table_lock); + + // fmon table lock + uwsgi.fmon_table_lock = uwsgi_mmap_shared_lock(); + uwsgi_lock_init(uwsgi.fmon_table_lock); + + // timer table lock + uwsgi.timer_table_lock = uwsgi_mmap_shared_lock(); + uwsgi_lock_init(uwsgi.timer_table_lock); + } + if (uwsgi.sharedareasize > 0) { uwsgi.sharedareamutex = uwsgi_mmap_shared_lock(); - if (!uwsgi.sharedareamutex) { - uwsgi_error("mmap()"); - exit(1); - } + uwsgi.sharedarea = mmap(NULL, uwsgi.page_size * uwsgi.sharedareasize, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0); if (uwsgi.sharedarea) { uwsgi_log("shared area mapped at %p, you can access it with uwsgi.sharedarea* functions.\n", uwsgi.sharedarea); @@ -863,7 +870,6 @@ options_parsed: } } -#endif if (uwsgi.cache_max_items > 0) { uwsgi.cache_items = mmap(NULL, sizeof(struct uwsgi_cache_item) * uwsgi.cache_max_items, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0); @@ -886,10 +892,6 @@ options_parsed: uwsgi.shared->cache_first_available_item = 1; uwsgi.cache_lock = uwsgi_mmap_shared_lock(); - if (!uwsgi.cache_lock) { - uwsgi_error("mmap()"); - exit(1); - } uwsgi_lock_init(uwsgi.cache_lock); uwsgi.p[111] = &uwsgi_cache_plugin; @@ -1300,15 +1302,17 @@ uwsgi.shared->hooks[UWSGI_MODIFIER_PING] = uwsgi_request_ping; //100 gettimeofday(&last_respawn, NULL); uwsgi.respawn_delta = last_respawn.tv_sec; } - for (i = 2 - uwsgi.master_process; i < uwsgi.numproc + 1; i++) { + else { // setup internal signalling system - if (socketpair(AF_UNIX, SOCK_STREAM, 0, uwsgi.workers[i].pipe)) { + if (socketpair(AF_UNIX, SOCK_STREAM, 0, uwsgi.shared->worker_signal_pipe)) { uwsgi_error("socketpair()\n"); exit(1); } + } + for (i = 2 - uwsgi.master_process; i < uwsgi.numproc + 1; i++) { pid = fork(); if (pid == 0) { - close(uwsgi.workers[i].pipe[0]); + close(uwsgi.shared->worker_signal_pipe[0]); uwsgi.mypid = getpid(); uwsgi.workers[i].pid = uwsgi.mypid; uwsgi.workers[i].id = i; @@ -1321,7 +1325,7 @@ uwsgi.shared->hooks[UWSGI_MODIFIER_PING] = uwsgi_request_ping; //100 exit(1); } else { uwsgi_log("spawned uWSGI worker %d (pid: %d, cores: %d)\n", i, pid, uwsgi.cores); - close(uwsgi.workers[i].pipe[1]); + //close(uwsgi.workers[i].pipe[1]); gettimeofday(&last_respawn, NULL); uwsgi.respawn_delta = last_respawn.tv_sec; } @@ -1422,9 +1426,9 @@ uwsgi.shared->hooks[UWSGI_MODIFIER_PING] = uwsgi_request_ping; //100 } - if (uwsgi.no_orphans) { - uwsgi.sockets_poll[uwsgi.sockets_cnt].fd = uwsgi.workers[uwsgi.mywid].pipe[1]; - uwsgi.sockets_poll[uwsgi.sockets_cnt].events = POLLIN; + if (uwsgi.master_process) { + uwsgi.sockets_poll[uwsgi.sockets_cnt].fd = uwsgi.shared->worker_signal_pipe[1]; + uwsgi.sockets_poll[uwsgi.sockets_cnt].events = POLLIN; } diff --git a/uwsgi.h b/uwsgi.h index 24523a19..6556ad36 100644 --- a/uwsgi.h +++ b/uwsgi.h @@ -11,6 +11,8 @@ #define wsgi_req_time ((wsgi_req->end_of_request.tv_sec * 1000000 + wsgi_req->end_of_request.tv_usec) - (wsgi_req->start_of_request.tv_sec * 1000000 + wsgi_req->start_of_request.tv_usec))/1000 +#define ushared uwsgi.shared + #define MAX_APPS 64 #define MAX_GENERIC_PLUGINS 64 @@ -392,6 +394,7 @@ struct uwsgi_plugin { void* (*encode_string)(char *); char* (*decode_string)(void *); + int (*signal_handler)(uint8_t, void *, char *, uint8_t); }; @@ -590,10 +593,11 @@ struct wsgi_request { #define LOADER_MAX 8 struct uwsgi_fmon { - char *filename; + char filename[0xff]; int fd; int id; int registered; + uint8_t sig; }; struct uwsgi_timer { @@ -856,15 +860,13 @@ struct uwsgi_server { uint32_t cache_max_items; struct uwsgi_cache_item *cache_items; void *cache; + void *cache_lock; - void *user_lock; + void *signal_table_lock; + void *fmon_table_lock; + void *timer_table_lock; - struct uwsgi_fmon files_monitored[64]; - int files_monitored_cnt; - - struct uwsgi_timer timers[64]; - int timers_cnt; }; struct uwsgi_lb_group { @@ -872,6 +874,22 @@ struct uwsgi_lb_group { int kind; }; +#define SIGNAL_KIND_NULL 0 +#define SIGNAL_KIND_WORKER 1 +#define SIGNAL_KIND_EVENT 2 +#define SIGNAL_KIND_SPOOLER 3 +#define SIGNAL_KIND_ERLANG 4 +#define SIGNAL_KIND_PROXY 5 +#define SIGNAL_KIND_MASTER 6 + +struct uwsgi_signal_entry { + uint8_t kind; + uint8_t modifier1; + uint8_t payload_size; + void *handler; + char payload[0xff]; +}; + struct uwsgi_lb_node { char name[101]; @@ -948,6 +966,15 @@ struct uwsgi_shared { uint16_t cache_first_available_item; uint16_t cache_first_available_item_tmp; + + int worker_signal_pipe[2]; + struct uwsgi_signal_entry signal_table[0xff]; + + struct uwsgi_fmon files_monitored[64]; + int files_monitored_cnt; + + struct uwsgi_timer timers[64]; + int timers_cnt; }; struct uwsgi_core { @@ -986,9 +1013,6 @@ struct uwsgi_worker { int manage_next_request; - // this is used for the internal signalling system - int pipe[2]; - struct uwsgi_core **cores; }; @@ -1273,8 +1297,6 @@ int uwsgi_cache_del(char *, uint16_t); char *uwsgi_cache_get(char *, uint16_t, uint16_t *); uint32_t uwsgi_cache_exists(char *, uint16_t); -#define uwsgi_mmap_shared_lock() mmap(NULL, sizeof(pthread_mutexattr_t) + sizeof(pthread_mutex_t), PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0) - void uwsgi_lock_init(void *); void uwsgi_lock(void *); void uwsgi_unlock(void *); @@ -1293,4 +1315,9 @@ int event_queue_add_file_monitor(int, char *, int *); struct uwsgi_fmon *event_queue_ack_file_monitor(int, void (*)(char *, uint32_t, char *)); -int register_signal(uint8_t, char *); +void *uwsgi_mmap_shared_lock(void); + +void uwsgi_register_signal(uint8_t, uint8_t, void *, uint8_t, char *, uint8_t); +int uwsgi_signal_handler(uint8_t); + +void uwsgi_register_file_monitor(uint8_t, char *, uint8_t, void *, uint8_t);