     Changing the expiry time of a timer while there are pending asynchronous
        waits causes those wait operations to be cancelled. To ensure that the action
        associated with the timer is performed only once, use something like this:
        used:
      </p>
<pre class="programlisting">void on_some_event()
{
  if (my_timer.expires_after(seconds(5)) &gt; 0)
  {
    // We managed to cancel the timer. Start new asynchronous wait.
    my_timer.async_wait(on_timeout);
  }
  else
  {
    // Too late,