Free Electron
Poison.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __core_Poison_h__
8 #define __core_Poison_h__
9 
10 namespace fe
11 {
12 
13 /** Death pill for threads.
14  */
15 class FE_DL_EXPORT Poison : public ObjectSafe<Poison>
16 {
17  public:
18  Poison(void);
19 virtual ~Poison(void);
20 
21  bool active(void);
22  void start(void);
23  void stop(void);
24 
25  private:
26  bool m_active;
27 };
28 
29 /** An exception to be thrown when active Poison has been detected. */
30 class FE_DL_EXPORT Poisoned //: public Exception
31 {
32  public:
33  Poisoned(void);
34 virtual ~Poisoned(void);
35 };
36 
37 
38 } /* namespace */
39 
40 
41 #endif /* __core_Poison_h__ */
42 
Object level locking for thread safety.
Definition: Safe.h:216
kernel
Definition: namespace.dox:3
Death pill for threads.
Definition: Poison.h:15
An exception to be thrown when active Poison has been detected.
Definition: Poison.h:30