Skip to content
This repository has been archived by the owner on Dec 16, 2019. It is now read-only.

Commit

Permalink
update stub in response to #622
Browse files Browse the repository at this point in the history
  • Loading branch information
krakjoe committed Sep 29, 2016
1 parent d814b0c commit 181316a
Showing 1 changed file with 0 additions and 143 deletions.
143 changes: 0 additions & 143 deletions examples/stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,16 +307,6 @@ public function kill() {}
* @return bool A boolean indication of success
*/
public function start($options = PTHREADS_INHERIT_ALL) {}

/**
* Will execute the Callable in the global scope
*
* @param Callable $block The code to execute
* @param ... $args Variable length list of arguments to pass to the Callable upon execution
* @link http://www.php.net/manual/en/thread.start.php
* @return bool A boolean indication of success
*/
public static function globally(Callable $block, $args) {}
}

/**
Expand Down Expand Up @@ -390,139 +380,6 @@ public function stack(Threaded &$work) {}
public function unstack(Threaded &$work = null) {}
}

/**
* Mutex class
*
* The static methods contained in the Mutex class provide direct access to Posix Mutex functionality.
*
* @link http://www.php.net/manual/en/class.mutex.php
*/
class Mutex
{

/**
* Create, and optionally lock a new Mutex for the caller
*
* @param bool $lock Setting lock to true will lock the Mutex for the caller before returning the handle
*
* @link http://www.php.net/manual/en/mutex.create.php
* @return int A newly created and optionally locked Mutex handle
*/
final public static function create($lock = false) {}

/**
* Destroy mutex
*
* Destroying Mutex handles must be carried out explicitly by the programmer when they are
* finished with the Mutex handle.
*
* @param int $mutex A handle returned by a previous call to Mutex::create().
*
* @link http://www.php.net/manual/en/mutex.destroy.php
* @return bool A boolean indication of success
*/
final public static function destroy($mutex) {}

/**
* Attempt to lock the Mutex for the caller.
*
* An attempt to lock a Mutex owned (locked) by another Thread will result in blocking.
*
* @param int $mutex A handle returned by a previous call to Mutex::create().
*
* @link http://www.php.net/manual/en/mutex.lock.php
* @return bool A boolean indication of success
*/
final public static function lock($mutex) {}

/**
* Attempt to lock the Mutex for the caller without blocking if the Mutex is owned (locked) by another Thread.
*
* @param int $mutex A handle returned by a previous call to Mutex::create().
*
* @link http://www.php.net/manual/en/mutex.trylock.php
* @return bool A boolean indication of success
*/
final public static function trylock($mutex) {}

/**
* Release mutex
*
* Attempts to unlock the Mutex for the caller, optionally destroying the Mutex handle.
* The calling thread should own the Mutex at the time of the call.
*
* @param int $mutex A handle returned by a previous call to Mutex::create().
* @param bool $destroy When true pthreads will destroy the Mutex after a successful unlock.
*
* @link http://www.php.net/manual/en/mutex.unlock.php
* @return bool A boolean indication of success
*/
final public static function unlock($mutex, $destroy = false) {}
}

/**
* Condition class
*
* The static methods contained in the Cond class provide direct access to Posix Condition Variables.
*
* @link http://www.php.net/manual/en/class.cond.php
*/
class Cond
{
/**
* Broadcast to all Threads blocking on a call to Cond::wait().
*
* @param int $condition A handle to a Condition Variable returned by a previous call to Cond::create()
*
* @link http://www.php.net/manual/en/cond.broadcast.php
* @return bool A boolean indication of success
*/
final public static function broadcast($condition) {}

/**
* Creates a new Condition Variable for the caller.
*
* @link http://www.php.net/manual/en/cond.create.php
* @return int A handle to a Condition Variable
*/
final public static function create() {}

/**
* Destroy a condition
*
* Destroying Condition Variable handles must be carried out explicitly by the programmer when they are
* finished with the Condition Variable.
* No Threads should be blocking on a call to Cond::wait() when the call to Cond::destroy() takes place.
*
* @param int $condition A handle to a Condition Variable returned by a previous call to Cond::create()
*
* @link http://www.php.net/manual/en/cond.destroy.php
* @return bool A boolean indication of success
*/
final public static function destroy($condition) {}

/**
* Signal a Condition
*
* @param int $condition A handle to a Condition Variable returned by a previous call to Cond::create()
*
* @link http://www.php.net/manual/en/cond.signal.php
* @return bool A boolean indication of success
*/
final public static function signal($condition) {}

/**
* Wait for a signal on a Condition Variable, optionally specifying a timeout to limit waiting time.
*
* @param int $condition A handle to a Condition Variable returned by a previous call to Cond::create()
* @param int $mutex A handle returned by a previous call to Mutex::create() and owned (locked) by the caller.
* @param int $timeout An optional timeout, in microseconds
*
* @return bool A boolean indication of success
*/
final public static function wait($condition, $mutex, $timeout = null) {}
}

/**
* Pool class
*
Expand Down

0 comments on commit 181316a

Please sign in to comment.