-1 This is asymmetric, the caller should be spawning and terminating, but we terminate also within process destructors? This looks like compensating for a programming error, needs more thought.
I will revert this, and please revert any code that is using this pattern. On Thu, Dec 3, 2015 at 6:12 AM, <[email protected]> wrote: > Repository: mesos > Updated Branches: > refs/heads/master c73c06fec -> 47fe84b66 > > > Added documentation about terminate/wait in Processes destructors. > > Based on a discussion here: > https://reviews.apache.org/r/40501/#review107290 > > Review: https://reviews.apache.org/r/40557 > > > Project: http://git-wip-us.apache.org/repos/asf/mesos/repo > Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/47fe84b6 > Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/47fe84b6 > Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/47fe84b6 > > Branch: refs/heads/master > Commit: 47fe84b666968c5cb18bac15b52e5bee1f347884 > Parents: c73c06f > Author: Joseph Wu <[email protected]> > Authored: Thu Dec 3 15:09:22 2015 +0100 > Committer: Bernd Mathiske <[email protected]> > Committed: Thu Dec 3 15:09:22 2015 +0100 > > ---------------------------------------------------------------------- > 3rdparty/libprocess/README.md | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > ---------------------------------------------------------------------- > > > > http://git-wip-us.apache.org/repos/asf/mesos/blob/47fe84b6/3rdparty/libprocess/README.md > ---------------------------------------------------------------------- > diff --git a/3rdparty/libprocess/README.md b/3rdparty/libprocess/README.md > index c3f309a..281bda6 100644 > --- a/3rdparty/libprocess/README.md > +++ b/3rdparty/libprocess/README.md > @@ -134,6 +134,20 @@ int main(int argc, char** argv) > ~~~ > ----> > > +> NOTE: In most cases, a process should have a destructor that terminates > +> and waits on the process to finish. The process does not automatically > +> terminate when the `Process` is deallocated. i.e.: > + > +~~~{.cpp} > +class MyProcess : public Process<MyProcess> { > + virtual ~MyProcess() > + { > + terminate(this); > + wait(this); > + } > +}; > +~~~ > + > --- > > ## Futures and Promises > >
