title: Why do I have the option to *not* call Concurrency::agent::done inside run?
body: <p>This is in the context of the Microsoft C++ Concurrency API.</p>
  
  <p>There's a class called <code>agent</code> (under <code>Concurrency</code> namespace), and it's basically a state machine you derive and implement pure virtual <code>agent::run</code>.</p>
  
  <p>Now, it is your responsibility to call <code>agent::start</code>, which will put it in a <em>runnable</em> state. You then call <code>agent::wait</code>*, or any of its variants, to actually execute the <code>agent::run</code> method.</p>
  
  <p>But why do we have to call <code>agent::done</code> within the body? I mean, the obvious answer is that <code>agent::wait</code>* will wait until done is signaled or the timeout has elapsed, but...</p>
  
  <p>What were the designers intending? Why not have the agent enter the done state when <code>agent::run</code> returns? That's what I want to know. Why do I have the option to not call <code>done</code>? The wait methods throw exceptions if the timeout has elapsed.</p>