Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
2acf5526
Commit
2acf5526
authored
Aug 20, 1998
by
Bob Halley
Browse files
update
parent
d740c17c
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/isc/pthreads/condition.c
0 → 100644
View file @
2acf5526
#include
<isc/condition.h>
#include
<errno.h>
boolean_t
os_condition_waituntil
(
os_condition_t
*
c
,
os_mutex_t
*
m
,
struct
timespec
*
ts
,
boolean_t
*
timeout
)
{
int
result
;
result
=
pthread_cond_timedwait
(
c
,
m
,
ts
);
if
(
result
==
0
)
{
*
timeout
=
FALSE
;
return
(
TRUE
);
}
else
if
(
result
==
ETIMEDOUT
)
{
*
timeout
=
TRUE
;
return
(
TRUE
);
}
return
(
FALSE
);
}
lib/isc/pthreads/include/isc/condition.h
View file @
2acf5526
...
...
@@ -3,9 +3,9 @@
#define CONDITION_H 1
#include
<pthread.h>
#include
<errno.h>
#include
<isc/boolean.h>
#include
<isc/mutex.h>
#include
<isc/assertions.h>
typedef
pthread_cond_t
os_condition_t
;
...
...
@@ -13,12 +13,13 @@ typedef pthread_cond_t os_condition_t;
#define os_condition_init(cp) (pthread_cond_init((cp), NULL) == 0)
#define os_condition_wait(cp, mp) (pthread_cond_wait((cp), (mp)) == 0)
#define os_condition_waituntil(cp, mp, tsp, top) \
(pthread_cond_timedwait((cp), (mp), (tsp)) == 0 \
? TRUE \
: ((*(top) = (errno == ETIMEDOUT)), FALSE))
#define os_condition_signal(cp) (pthread_cond_signal((cp)) == 0)
#define os_condition_broadcast(cp) (pthread_cond_broadcast((cp)) == 0)
#define os_condition_destroy(cp) (pthread_cond_destroy((cp)) == 0)
boolean_t
os_condition_waituntil
(
os_condition_t
*
,
os_mutex_t
*
,
struct
timespec
*
,
boolean_t
*
);
#endif
/* CONDITION_H */
lib/isc/task.c
View file @
2acf5526
...
...
@@ -766,6 +766,12 @@ task_manager_destroy(task_manager_t *managerp) {
/*
* Wait for all the worker threads to exit.
*
* XXX This will become a timed wait. If all the workers haven't
* died after we've waited the specified interval, we will
* kill the worker threads. Should we join with the worker
* threads after killing them or just leave them detached and
* hope they go away?
*/
while
(
manager
->
workers
>
0
)
WAIT
(
&
manager
->
no_workers
,
&
manager
->
lock
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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