void BasicEventTest::testNullMutex() { Poco::BasicEvent<int, NullMutex> ev; int tmp = 0; assert (_count == 0); ev += delegate(this, &BasicEventTest::onSimple); ev += delegate(this, &BasicEventTest::onSimple); ev.notify(this, tmp); assert (_count == 2); ev -= delegate(this, &BasicEventTest::onSimple); ev.notify(this, tmp); assert (_count == 3); }
void run() { int tmp = 0; while (!_stopped) { ++tmp; push_event.notify(this, tmp); Poco::Thread::sleep(1000); } }