]> git.sur5r.net Git - openldap/commitdiff
Avoid filling the wake_sds when massive numbers of connections close at once.
authorHoward Chu <hyc@openldap.org>
Tue, 16 Nov 2004 20:26:50 +0000 (20:26 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 16 Nov 2004 20:26:50 +0000 (20:26 +0000)
servers/slapd/daemon.c

index 2334137cfee8f9872804f287d585016d6c73c50c..87e65ecfd230fde946bd3b8adc543d3b5eb62e0e 100644 (file)
@@ -74,14 +74,9 @@ Listener **slap_listeners = NULL;
 static ber_socket_t wake_sds[2];
 static int emfile;
 
-#if defined(NO_THREADS) || defined(HAVE_GNU_PTH)
 static int waking;
 #define WAKE_LISTENER(w) \
-((w && !waking) ? tcp_write( wake_sds[1], "0", 1 ), waking=1 : 0)
-#else
-#define WAKE_LISTENER(w) \
-do { if (w) tcp_write( wake_sds[1], "0", 1 ); } while(0)
-#endif
+do { if (w && !waking) tcp_write( wake_sds[1], "0", 1 ); waking=w; } while(0)
 
 volatile sig_atomic_t slapd_shutdown = 0, slapd_gentle_shutdown = 0;
 volatile sig_atomic_t slapd_abrupt_shutdown = 0;
@@ -1304,9 +1299,7 @@ slapd_daemon_task(
                if( FD_ISSET( wake_sds[0], &readfds ) ) {
                        char c[BUFSIZ];
                        tcp_read( wake_sds[0], c, sizeof(c) );
-#if defined(NO_THREADS) || defined(HAVE_GNU_PTH)
                        waking = 0;
-#endif
                        ns--;
                        continue;
                }