/* ====================================================================
 * Copyright (c) 2003-2006, Martin Hauner
 *                          http://subcommander.tigris.org
 *
 * Subcommander is licensed as described in the file doc/COPYING, which
 * you should have received as part of this distribution.
 * ====================================================================
 */

// sc
#include "Cancel.h"
#include "util/Guard.h"


Cancel::Cancel() : _canceled(false)
{
}

bool Cancel::isCanceled()
{
  sc::Guard<sc::Mutex> guard(_mutex);

  return _canceled;
}

void Cancel::setCanceled()
{
  sc::Guard<sc::Mutex> guard(_mutex);

  _canceled = true;
}
