• PHP Video Tutorials

PHP - Threaded::unlock() Function



Threaded::unlock - Synchronization

Syntax

public boolean Threaded::unlock( void )

Threaded::unlock() function can unlock the referenced objects storage for calling context.

Threaded::unlock() function doesn't have any parameters and can return a boolean indication of success.

Example

<?php
   class My extends Thread {
      public function run() {
         var_dump($this->lock());
         /** nobody can read or write **/
         var_dump($this->unlock());
         /** reading / writing resumed for all other contexts */
      }
   }
   $my = new My();
   $my->start();
?>
php_function_reference.htm
Advertisements