Skip to content

Commit

Permalink
Increase sleep time to 250ms to not hog the cpu too much
Browse files Browse the repository at this point in the history
  • Loading branch information
obaterspok authored Jun 27, 2023
1 parent 4b2f9ec commit 95d36db
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ldap/servers/slapd/daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ slapd_daemon(daemon_ports_t *ports)
/* The meat of the operation is in a loop on a call to select */
while (!g_get_shutdown()) {

usleep(1000);
usleep(250 * 1000);
}
/* We get here when the server is shutting down */
/* Do what we have to do before death */
Expand Down Expand Up @@ -1196,7 +1196,7 @@ slapd_daemon(daemon_ports_t *ports)
/* no data */
}
}
DS_Sleep(PR_INTERVAL_NO_WAIT);
DS_(PR_INTERVAL_NO_WAIT);

Check warning on line 1199 in ldap/servers/slapd/daemon.c

View workflow job for this annotation

GitHub Actions / compile (GCC)

implicit declaration of function 'DS_' [-Wimplicit-function-declaration]
if (threads != g_get_active_threadcnt()) {
slapi_log_err(SLAPI_LOG_TRACE, "slapd_daemon",
"slapd shutting down - waiting for %" PRIu64 " threads to terminate\n",
Expand Down Expand Up @@ -1994,10 +1994,10 @@ init_shutdown_detect(void)
* to get set correctly unless the primordial thread gets a chance
* to run before we make the call to SIGNAL. (At this point the
* the primordial thread has spawned the daemon thread which called
* this function.) The call to DS_Sleep will give the primordial
* this function.) The call to DS_ will give the primordial
* thread a chance to run.
*/
DS_Sleep(0);
DS_(0);
#endif
(void)SIGNAL(SIGPIPE, SIG_IGN);
(void)SIGNAL(SIGCHLD, slapd_wait4child);
Expand Down

0 comments on commit 95d36db

Please sign in to comment.