Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
ISC Open Source Projects
BIND
Commits
0eb2572d
Commit
0eb2572d
authored
Jun 22, 2000
by
Michael Graff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add isc_thread_setconcurrency()
parent
52cff07f
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
186 additions
and
120 deletions
+186
-120
acconfig.h
acconfig.h
+5
-0
bin/tests/entropy2_test.c
bin/tests/entropy2_test.c
+0
-10
config.h.in
config.h.in
+5
-0
configure
configure
+160
-109
configure.in
configure.in
+3
-1
lib/isc/pthreads/include/isc/thread.h
lib/isc/pthreads/include/isc/thread.h
+3
-0
lib/isc/pthreads/thread.c
lib/isc/pthreads/thread.c
+10
-0
No files found.
acconfig.h
View file @
0eb2572d
...
...
@@ -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
...
...
bin/tests/entropy2_test.c
View file @
0eb2572d
...
...
@@ -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
);
...
...
config.h.in
View file @
0eb2572d
...
...
@@ -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
...
...
configure
View file @
0eb2572d
This diff is collapsed.
Click to expand it.
configure.in
View file @
0eb2572d
...
...
@@ -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.15
5
$)
AC_REVISION($Revision: 1.15
6
$)
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.
...
...
lib/isc/pthreads/include/isc/thread.h
View file @
0eb2572d
...
...
@@ -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) \
...
...
lib/isc/pthreads/thread.c
View file @
0eb2572d
...
...
@@ -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
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment