#include <once.hh>
Collaboration diagram for atoms::Once:

This doesn't use pthread_once because that isn't flexible to support calling a slot. Instead, it just does it with a bool and a Mutex.
Definition at line 24 of file once.hh.
Public Member Functions | |
| Once () | |
| Initializes data. | |
| void | operator() (const boost::function< void()> &action) |
| Performs the action iff none has been performed through this object before. | |
Private Attributes | |
| bool | done |
| True iff the action has been performed. | |
| Mutex | m |
| Mutex to avoid race condition. | |
|
|
Initializes data.
Definition at line 27 of file once.hh. References done. |
|
|
Performs the action iff none has been performed through this object before. If an exception is thrown, it will be as if the action was not performed. |
|
|
True iff the action has been performed.
Definition at line 38 of file once.hh. Referenced by Once(), and operator()(). |
|
|
Mutex to avoid race condition.
Definition at line 41 of file once.hh. Referenced by operator()(). |
1.3.5