malkusch\lock\mutex\CASMutexTest::testNotify PHP Method

testNotify() public method

Tests notify() will stop the iteration and return the result.
public testNotify ( )
    public function testNotify()
    {
        $i = 0;
        $mutex = new CASMutex();
        $mutex->synchronized(function () use($mutex, &$i) {
            $i++;
            $mutex->notify();
        });
        $this->assertEquals(1, $i);
    }