From 7ff92d3746fdedc76ddd778c4c5d42172665f291 Mon Sep 17 00:00:00 2001 From: Daniel Larimer Date: Tue, 6 Aug 2013 12:45:49 -0400 Subject: [PATCH] added ability to query cancel flag from future --- include/fc/thread/future.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/fc/thread/future.hpp b/include/fc/thread/future.hpp index 06c4793..31a614c 100644 --- a/include/fc/thread/future.hpp +++ b/include/fc/thread/future.hpp @@ -52,6 +52,7 @@ namespace fc { const char* get_desc()const; void cancel(); + bool canceled()const { return _canceled; } bool ready()const; bool error()const; @@ -195,6 +196,7 @@ namespace fc { bool error()const { return m_prom->error(); } void cancel()const { m_prom->cancel(); } + bool canceled()const { return m_prom->canceled(); } /** * @pre valid() @@ -233,7 +235,8 @@ namespace fc { m_prom->wait_until(tp); } - bool valid()const { return !!m_prom; } + bool valid()const { return !!m_prom; } + bool canceled()const { return m_prom->canceled(); } /// @pre valid() bool ready()const { return m_prom->ready(); }