Fawkes API  Fawkes Development Version
executor.h
1 
2 /***************************************************************************
3  * blocked_timing_runner.h - Interface to exec BlockedTimingAspect threads
4  *
5  * Created: Sat Aug 02 11:45:59 2008
6  * Copyright 2006-2008 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef __ASPECT_BLOCKED_TIMING_EXECUTOR_H_
25 #define __ASPECT_BLOCKED_TIMING_EXECUTOR_H_
26 
27 #include <aspect/blocked_timing.h>
28 #include <list>
29 #include <string>
30 
31 namespace fawkes {
32 
33 class Barrier;
34 
36 {
37  public:
38  virtual ~BlockedTimingExecutor();
39 
41  unsigned int timeout_usec = 0) = 0;
42  virtual void wakeup(BlockedTimingAspect::WakeupHook hook,
43  Barrier *barrier = 0) = 0;
44 
45  virtual void try_recover(std::list<std::string> &recovered_threads) = 0;
46 
47  virtual bool timed_threads_exist() = 0;
48  virtual void wait_for_timed_threads() = 0;
49  virtual void interrupt_timed_thread_wait() = 0;
50 };
51 
52 } // end namespace fawkes
53 
54 #endif
virtual void wakeup_and_wait(BlockedTimingAspect::WakeupHook hook, unsigned int timeout_usec=0)=0
Wakeup thread for given hook and wait for completion.
virtual bool timed_threads_exist()=0
Check if any timed threads exist.
virtual void wait_for_timed_threads()=0
Wait for timed threads.
Fawkes library namespace.
virtual void interrupt_timed_thread_wait()=0
Interrupt any currently running wait_for_timed_threads() and cause it to throw an InterruptedExceptio...
WakeupHook
Type to define at which hook the thread is woken up.
Blocked timing executor.
Definition: executor.h:35
virtual ~BlockedTimingExecutor()
Virtual empty destructor.
Definition: executor.cpp:81
virtual void wakeup(BlockedTimingAspect::WakeupHook hook, Barrier *barrier=0)=0
Wakeup thread for given hook.
virtual void try_recover(std::list< std::string > &recovered_threads)=0
Try to recover threads.
A barrier is a synchronization tool which blocks until a given number of threads have reached the bar...
Definition: barrier.h:32