summaryrefslogtreecommitdiff
path: root/source3/lib/server_prefork.h
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2011-05-16 10:46:35 -0400
committerAndreas Schneider <asn@samba.org>2011-08-10 18:14:04 +0200
commit0a910c93472e1e4aff120219e09866d4a20ec2b2 (patch)
tree21b595373c4fe52393fbafafe3376959799c8ff2 /source3/lib/server_prefork.h
parente0aa6eec0b498db345666df4b02d4917fa3e259a (diff)
downloadsamba-0a910c93472e1e4aff120219e09866d4a20ec2b2.tar.gz
samba-0a910c93472e1e4aff120219e09866d4a20ec2b2.tar.bz2
samba-0a910c93472e1e4aff120219e09866d4a20ec2b2.zip
s3-prefork: Provide a cleanup function
This way the parent doesn't need to know how to handle dead children and keeps all of that within the prefork abstraction. Signed-off-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3/lib/server_prefork.h')
-rw-r--r--source3/lib/server_prefork.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/source3/lib/server_prefork.h b/source3/lib/server_prefork.h
index f5c86b4043..f4d03ccca1 100644
--- a/source3/lib/server_prefork.h
+++ b/source3/lib/server_prefork.h
@@ -160,18 +160,14 @@ int prefork_retire_children(struct prefork_pool *pfp,
* @return The number of children actually serving clients
*/
int prefork_count_active_children(struct prefork_pool *pfp, int *total);
+
/**
-* @brief Mark a child structure as free, based on the dead child pid.
-* This function is called when the parent gets back notice a child
-* has died through waitpid. It is critical to call this function
-* when children are reaped so that memory slots can be freed.
+* @brief Perform cleanups, like waiting (WNOHANG) dead children.
+* MUST be called regularly from the parent main loop.
*
* @param pfp The pool.
-* @param pid The child pid.
-*
-* @return True if the slot was clared. False if the pid is not listed.
*/
-bool prefork_mark_pid_dead(struct prefork_pool *pfp, pid_t pid);
+void prefork_cleanup_loop(struct prefork_pool *pfp);
/**
* @brief Inform all children that they are allowed to accept 'max' clients