malkusch\lock\mutex\CASMutex::notify PHP Метод

notify() публичный Метод

Notifies the Mutex about a successfull CAS operation.
public notify ( )
    public function notify()
    {
        $this->loop->end();
    }

Usage Example

Пример #1
0
 /**
  * Tests that the code is executed more times.
  *
  * @test
  */
 public function testIteration()
 {
     $i = 0;
     $mutex = new CASMutex();
     $mutex->synchronized(function () use($mutex, &$i) {
         $i++;
         if ($i > 1) {
             $mutex->notify();
         }
     });
     $this->assertEquals(2, $i);
 }