2636 |
2636 |
2637 void *my_server_loop(void *threadid) |
2637 void *my_server_loop(void *threadid) |
2638 { |
2638 { |
2639 socklen_t addrlen; |
2639 socklen_t addrlen; |
2640 int s, optval = 1; |
2640 int s, optval = 1; |
|
2641 pid_t pid = gettid(); |
2641 |
2642 |
2642 my_server_state = 1; |
2643 my_server_state = 1; |
2643 syslog(LOG_NOTICE, "Thread my_server_loop started"); |
2644 syslog(LOG_NOTICE, "Thread my_server_loop started, pid=%d", pid); |
2644 |
2645 |
2645 /* |
2646 /* |
2646 * Prepare thread to stop in blocking accept() call. |
2647 * Prepare thread to stop in blocking accept() call. |
2647 */ |
2648 */ |
2648 pthread_cleanup_push(cleanup_handler, NULL); |
2649 pthread_cleanup_push(cleanup_handler, NULL); |