See also: mutex class reference.

Model of
Description

The mutex class locks an internal mutex when it receives a signal, and then forwards the signal. mutex is an _instantiator_ with the Instantiation boost::mutex::scoped_lock and Member boost::mutex.

Example

signals::timed_generator<void ()> banger1;
signals::timed_generator<void ()> banger2;
signals::mutex<void ()> lock;
signals::counter<void (), signals::output::unfused, volatile int> counter;

banger1 >>= lock >>= counter;
banger2 >>= lock;
banger1.enable(0.5, 5);
banger2.enable(0.5, 5);

while (counter.count() < 10) {}
int x = counter.count();
BOOST_CHECK_EQUAL(x, 10);
banger1.join();
banger2.join();