initialize alarm and exception thread ONLY in the master

This commit is contained in:
Unbit
2013-02-26 19:29:29 +01:00
parent a71d9953a1
commit 61a1ca4ca4
4 changed files with 12 additions and 0 deletions
+2
View File
@@ -262,7 +262,9 @@ void uwsgi_alarms_init() {
usl = usl->next;
}
#endif
}
void uwsgi_alarm_thread_start() {
// start the alarm_threa
uwsgi.alarm_thread = uwsgi_thread_new(uwsgi_alarm_thread_loop);
if (!uwsgi.alarm_thread) {
+4
View File
@@ -458,6 +458,7 @@ static void uwsgi_exception_handler_thread_loop(struct uwsgi_thread *ut) {
}
}
}
uwsgi_log("STATUS = %d %d %d %d\n", uwsgi.status.gracefully_reloading, uwsgi.status.brutally_reloading, 0, 0);
}
}
@@ -483,6 +484,9 @@ void uwsgi_exception_setup_handlers() {
usl->custom_ptr = uehi;
usl = usl->next;
}
}
void uwsgi_exceptions_handler_thread_start() {
// start the exception_handler_thread
uwsgi.exception_handler_thread = uwsgi_thread_new(uwsgi_exception_handler_thread_loop);
+3
View File
@@ -371,6 +371,9 @@ int master_loop(char **argv, char **environ) {
}
uwsgi_alarm_thread_start();
uwsgi_exceptions_handler_thread_start();
#ifdef UWSGI_SSL
uwsgi_start_legions();
#endif
+3
View File
@@ -3857,6 +3857,9 @@ struct uwsgi_exception_handler *uwsgi_register_exception_handler(char *, int (*)
void uwsgi_async_queue_is_full(time_t);
char *uwsgi_get_header(struct wsgi_request *, char *, uint16_t, uint16_t *);
void uwsgi_alarm_thread_start(void);
void uwsgi_exceptions_handler_thread_start(void);
#define uwsgi_response_add_connection_close(x) uwsgi_response_add_header(x, "Connection", 10, "close", 5)
#define uwsgi_response_add_content_type(x, y, z) uwsgi_response_add_header(x, "Content-Type", 12, y, z)