Commit 0eb2572d authored by Michael Graff's avatar Michael Graff

add isc_thread_setconcurrency()

parent 52cff07f
......@@ -65,6 +65,11 @@
/* define is getaddrinfo() exists */
#undef HAVE_GETADDRINFO
/* define if pthread_setconcurrency() should be called to tell the
* OS how many threads we might want to run.
*/
#undef CALL_PTHREAD_SETCONCURRENCY
/* Shut up warnings about sputaux in stdio.h on BSD/OS pre-4.1 */
#undef SHUTUP_SPUTAUX
#ifdef SHUTUP_SPUTAUX
......
......@@ -76,11 +76,6 @@ stop(isc_entropysource_t *source, void *arg) {
printf("stop called\n");
}
/*
* This function is by no way a good one to actually add entropy into
* the system. It is intended to fool the entropy system into beliving
* there are actual bits from us.
*/
static isc_result_t
get(isc_entropysource_t *source, void *arg, isc_boolean_t blocking) {
isc_keyboard_t *kbd = (isc_keyboard_t *)arg;
......@@ -90,11 +85,6 @@ get(isc_entropysource_t *source, void *arg, isc_boolean_t blocking) {
isc_uint32_t extra;
unsigned char c;
/*
* Here, we should check to see if we are in blocking mode or not.
* If we will block and the application asked us not to,
* we should return an error instead, rather than block.
*/
if (!blocking)
return (ISC_R_NOENTROPY);
......
......@@ -76,6 +76,11 @@
/* define is getaddrinfo() exists */
#undef HAVE_GETADDRINFO
/* define if pthread_setconcurrency() should be called to tell the
* OS how many threads we might want to run.
*/
#undef CALL_PTHREAD_SETCONCURRENCY
/* Shut up warnings about sputaux in stdio.h on BSD/OS pre-4.1 */
#undef SHUTUP_SPUTAUX
#ifdef SHUTUP_SPUTAUX
......
This diff is collapsed.
......@@ -13,7 +13,7 @@ dnl PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
dnl ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
dnl SOFTWARE.
AC_REVISION($Revision: 1.155 $)
AC_REVISION($Revision: 1.156 $)
AC_PREREQ(2.13)
......@@ -312,6 +312,8 @@ case "$host" in
#
*-solaris*)
AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
AC_CHECK_FUNC(pthread_setconcurrency,
AC_DEFINE(CALL_PTHREAD_SETCONCURRENCY))
;;
#
# UnixWare does things its own way.
......
......@@ -33,6 +33,9 @@ typedef isc_threadresult_t (*isc_threadfunc_t)(isc_threadarg_t);
isc_result_t
isc_thread_create(isc_threadfunc_t, isc_threadarg_t, isc_thread_t *);
void
isc_thread_setconcurrency(unsigned int level);
/* XXX We could do fancier error handling... */
#define isc_thread_join(t, rp) \
......
......@@ -18,6 +18,7 @@
#include <config.h>
#include <isc/thread.h>
#include <isc/util.h>
#ifndef THREAD_MINSTACKSIZE
#define THREAD_MINSTACKSIZE (64 * 1024)
......@@ -51,3 +52,12 @@ isc_thread_create(isc_threadfunc_t func, isc_threadarg_t arg,
return (ISC_R_SUCCESS);
}
void
isc_thread_setconcurrency(unsigned int level) {
#if defined(CALL_PTHREAD_SETCONCURRENCY)
(void)pthread_setconcurrency(level);
#else
UNUSED(level);
#endif
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment