- /** Tests whether the given activity is terminated yet. This is a pure function. */
- virtual bool test() = 0;
- virtual const char* get_cname() = 0;
- virtual const std::string& get_name() = 0;
+ /** Tests whether the given activity is terminated yet. */
+ virtual bool test();
+
+ /** Blocks the progression of this activity until it gets resumed */
+ virtual Activity* suspend();
+ /** Unblock the progression of this activity if it was suspended previously */
+ virtual Activity* resume();
+ /** Whether or not the progression of this activity is blocked */
+ bool is_suspended() const { return suspended_; }
+
+ virtual const char* get_cname() const = 0;
+ virtual const std::string& get_name() const = 0;