3150. [func] Improved startup and reconfiguration time by

enabling zones to load in multiple threads. [RT #25333]
This commit is contained in:
Evan Hunt
2011-09-02 21:15:39 +00:00
parent 541dd4d80f
commit 8a2ab2b920
37 changed files with 1873 additions and 177 deletions

View File

@@ -14,12 +14,14 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: isctest.c,v 1.3 2011/07/28 04:04:37 each Exp $ */
/* $Id: isctest.c,v 1.4 2011/09/02 21:15:38 each Exp $ */
/*! \file */
#include <config.h>
#include <time.h>
#include <isc/app.h>
#include <isc/buffer.h>
#include <isc/entropy.h>
@@ -153,3 +155,24 @@ isc_test_end() {
isc_mem_destroy(&mctx);
}
/*
* Sleep for 'usec' microseconds.
*/
void
isc_test_nap(isc_uint32_t usec) {
#ifdef HAVE_NANOSLEEP
struct timespec ts;
ts.tv_sec = usec / 1000000;
ts.tv_nsec = (usec % 1000000) * 1000;
nanosleep(&ts, NULL);
#elif HAVE_USLEEP
usleep(usec);
#else
/*
* No fractional-second sleep function is available, so we
* round up to the nearest second and sleep instead
*/
sleep((usec / 1000000) + 1);
#endif
}