diff --git a/src/sbbs3/ftpsrvr.c b/src/sbbs3/ftpsrvr.c index ea8b3e83e548f9f3dc8674524b8e29ec3854c105..a6287982124482d323ec40c21c7a8d423c059a73 100644 --- a/src/sbbs3/ftpsrvr.c +++ b/src/sbbs3/ftpsrvr.c @@ -1346,6 +1346,7 @@ static void send_thread(void* arg) xfer=*(xfer_t*)arg; free(arg); + SetThreadName("FTP Send thread"); thread_up(TRUE /* setuid */); length=flength(xfer.filename); @@ -1604,6 +1605,7 @@ static void receive_thread(void* arg) xfer=*(xfer_t*)arg; free(arg); + SetThreadName("FTP RECV Thread"); thread_up(TRUE /* setuid */); if((fp=fopen(xfer.filename,xfer.append ? "ab" : "wb"))==NULL) { @@ -2396,6 +2398,7 @@ static void ctrl_thread(void* arg) JSString* js_str; #endif + SetThreadName("FTP CTRL thread"); thread_up(TRUE /* setuid */); lastactive=time(NULL); @@ -4604,6 +4607,7 @@ void DLLCALL ftp_server(void* arg) ftp_ver(); startup=(ftp_startup_t*)arg; + SetThreadName("FTP Server"); #ifdef _THREAD_SUID_BROKEN if(thread_suid_broken) diff --git a/src/sbbs3/js_global.c b/src/sbbs3/js_global.c index fefc6d50f8aff01418170d5962648894fd13a5fc..0863e1ad4c61a24d676ea31c78dfd4692ea5d678 100644 --- a/src/sbbs3/js_global.c +++ b/src/sbbs3/js_global.c @@ -117,6 +117,7 @@ static void background_thread(void* arg) jsval result=JSVAL_VOID; jsval exit_code; + SetThreadName("JS Background Thread"); msgQueueAttach(bg->msg_queue); JS_SetContextThread(bg->cx); JS_BEGINREQUEST(bg->cx); diff --git a/src/sbbs3/main.cpp b/src/sbbs3/main.cpp index 0ea0d0e91749626f97ab4b4117cace31566f404a..5fdbf1a68fffc2fe7a2bdf687c7a7383685d2f65 100644 --- a/src/sbbs3/main.cpp +++ b/src/sbbs3/main.cpp @@ -1414,6 +1414,7 @@ void input_thread(void *arg) SOCKET high_socket; SOCKET sock; + SetThreadName("Node Input Thread"); thread_up(TRUE /* setuid */); #ifdef _DEBUG @@ -1687,6 +1688,7 @@ void passthru_output_thread(void* arg) int rd; int wr; + SetThreadName("Passthrough Output Thread"); thread_up(FALSE /* setuid */); sbbs->passthru_output_thread_running = true; @@ -1798,6 +1800,7 @@ void passthru_input_thread(void* arg) BYTE ch; int i; + SetThreadName("Passthrough Input Thread"); thread_up(FALSE /* setuid */); sbbs->passthru_input_thread_running = true; @@ -1890,6 +1893,7 @@ void output_thread(void* arg) struct timeval tv; ulong mss=IO_THREAD_BUF_SIZE; + SetThreadName("Node Output Thread"); thread_up(TRUE /* setuid */); if(sbbs->cfg.node_num) @@ -2103,6 +2107,7 @@ void event_thread(void* arg) sbbs_srand(); /* Seed random number generator */ + SetThreadName("BBS Events Thread"); thread_up(TRUE /* setuid */); #ifdef JAVASCRIPT @@ -3797,6 +3802,7 @@ void node_thread(void* arg) sbbs_t* sbbs = (sbbs_t*) arg; update_clients(); + SetThreadName("Node Thread"); thread_up(TRUE /* setuid */); #ifdef _DEBUG @@ -4299,6 +4305,8 @@ void DLLCALL bbs_thread(void* arg) startup->shutdown_now=FALSE; terminate_server=false; + SetThreadName("BBS Thread"); + do { thread_up(FALSE /* setuid */); diff --git a/src/sbbs3/sbbscon.c b/src/sbbs3/sbbscon.c index 0def7218340c68a83f44b107eb79a3e2d2442489..d1aac1dfdbe6a671c45c07d86eaebf2b9c7bd329 100644 --- a/src/sbbs3/sbbscon.c +++ b/src/sbbs3/sbbscon.c @@ -1090,6 +1090,7 @@ static void handle_sigs(void) int sig=0; sigset_t sigs; + SetThreadName("Signal Handler Thread"); thread_up(NULL,TRUE,TRUE); if (is_daemon) { @@ -1197,6 +1198,7 @@ int main(int argc, char** argv) printf("\nSynchronet Console for %s Version %s%c %s\n\n" ,PLATFORM_DESC,VERSION,REVISION,COPYRIGHT_NOTICE); + SetThreadName("Main Thread"); atexit(cleanup); ctrl_dir=getenv("SBBSCTRL"); /* read from environment variable */ diff --git a/src/sbbs3/websrvr.c b/src/sbbs3/websrvr.c index 71e4c68aa450cdcab67773a2ddfdb4698fd5d6ab..e2351582e159464c5d1ffe4e265656cdd785367e 100644 --- a/src/sbbs3/websrvr.c +++ b/src/sbbs3/websrvr.c @@ -4752,6 +4752,7 @@ void http_output_thread(void *arg) int i; unsigned mss=OUTBUF_LEN; + SetThreadName("HTTP Output Thread"); obuf=&(session->outbuf); /* Destroyed at end of function */ if((i=pthread_mutex_init(&session->outbuf_write,NULL))!=0) { @@ -4869,6 +4870,7 @@ void http_session_thread(void* arg) int loop_count; BOOL init_error; + SetThreadName("HTTP Session Thread"); pthread_mutex_lock(&((http_session_t*)arg)->struct_filled); pthread_mutex_unlock(&((http_session_t*)arg)->struct_filled); pthread_mutex_destroy(&((http_session_t*)arg)->struct_filled); @@ -5173,6 +5175,7 @@ void http_logging_thread(void* arg) if(!base[0]) SAFEPRINTF(base,"%slogs/http-",scfg.logs_dir); + SetThreadName("HTTP Logging Thread"); filename[0]=0; newfilename[0]=0; @@ -5296,6 +5299,7 @@ void DLLCALL web_server(void* arg) startup=(web_startup_t*)arg; + SetThreadName("Web Server"); web_ver(); /* get CVS revision */ if(startup==NULL) {