Add a method to ProcessReaper to forget a tracked pid
Allow callers to remove a tracked pid if tracking is
no longer desired (e.g., if the caller has reaped the
process themselves.)
BUG=chromium:535910
Change-Id: Ie056c54a66c5aed539d2a77a41135f9b2da66582
diff --git a/brillo/process_reaper.h b/brillo/process_reaper.h
index d88f572..937c88c 100644
--- a/brillo/process_reaper.h
+++ b/brillo/process_reaper.h
@@ -44,6 +44,13 @@
pid_t pid,
const ChildCallback& callback);
+ // Stop watching child process |pid|. This is useful in situations
+ // where the child process may have been reaped outside of the signal
+ // handler, or the caller is no longer interested in being notified about
+ // this child process anymore. Returns true if a child was removed from
+ // the watchlist.
+ bool ForgetChild(pid_t pid);
+
private:
// SIGCHLD handler for the AsynchronousSignalHandler. Always returns false
// (meaning that the signal handler should not be unregistered).