-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
615 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
namespace python\threading; | ||
|
||
/** | ||
* @property $broken | ||
* @property $n_waiting | ||
* @property $parties | ||
*/ | ||
class Barrier | ||
{ | ||
private $_self; | ||
|
||
public function __construct($parties, $action = null, $timeout = null) | ||
{ | ||
$this->_self = \PyCore::import('threading')->Barrier($parties, $action, $timeout); | ||
} | ||
|
||
public function abort() | ||
{ | ||
return $this->_self->abort(); | ||
} | ||
|
||
public function reset() | ||
{ | ||
return $this->_self->reset(); | ||
} | ||
|
||
public function wait($timeout = null) | ||
{ | ||
return $this->_self->wait($timeout); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
namespace python\threading; | ||
|
||
/** | ||
*/ | ||
class BoundedSemaphore | ||
{ | ||
private $_self; | ||
|
||
public function __construct($value = 1) | ||
{ | ||
$this->_self = \PyCore::import('threading')->BoundedSemaphore($value); | ||
} | ||
|
||
public function acquire($blocking = true, $timeout = null) | ||
{ | ||
return $this->_self->acquire($blocking, $timeout); | ||
} | ||
|
||
public function release($n = 1) | ||
{ | ||
return $this->_self->release($n); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
namespace python\threading; | ||
|
||
/** | ||
*/ | ||
class BrokenBarrierError | ||
{ | ||
private $_self; | ||
|
||
public function __construct() | ||
{ | ||
$this->_self = \PyCore::import('threading')->BrokenBarrierError(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
namespace python\threading; | ||
|
||
/** | ||
*/ | ||
class Condition | ||
{ | ||
private $_self; | ||
|
||
public function __construct($lock = null) | ||
{ | ||
$this->_self = \PyCore::import('threading')->Condition($lock); | ||
} | ||
|
||
public function notify($n = 1) | ||
{ | ||
return $this->_self->notify($n); | ||
} | ||
|
||
public function notifyAll() | ||
{ | ||
return $this->_self->notifyAll(); | ||
} | ||
|
||
public function notify_all() | ||
{ | ||
return $this->_self->notify_all(); | ||
} | ||
|
||
public function wait($timeout = null) | ||
{ | ||
return $this->_self->wait($timeout); | ||
} | ||
|
||
public function wait_for($predicate, $timeout = null) | ||
{ | ||
return $this->_self->wait_for($predicate, $timeout); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
namespace python\threading; | ||
|
||
/** | ||
*/ | ||
class Event | ||
{ | ||
private $_self; | ||
|
||
public function __construct() | ||
{ | ||
$this->_self = \PyCore::import('threading')->Event(); | ||
} | ||
|
||
public function clear() | ||
{ | ||
return $this->_self->clear(); | ||
} | ||
|
||
public function isSet() | ||
{ | ||
return $this->_self->isSet(); | ||
} | ||
|
||
public function is_set() | ||
{ | ||
return $this->_self->is_set(); | ||
} | ||
|
||
public function set() | ||
{ | ||
return $this->_self->set(); | ||
} | ||
|
||
public function wait($timeout = null) | ||
{ | ||
return $this->_self->wait($timeout); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
namespace python\threading; | ||
|
||
/** | ||
*/ | ||
class ExceptHookArgs | ||
{ | ||
private $_self; | ||
|
||
public function __construct() | ||
{ | ||
$this->_self = \PyCore::import('threading')->ExceptHookArgs(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
namespace python\threading; | ||
|
||
/** | ||
*/ | ||
class Semaphore | ||
{ | ||
private $_self; | ||
|
||
public function __construct($value = 1) | ||
{ | ||
$this->_self = \PyCore::import('threading')->Semaphore($value); | ||
} | ||
|
||
public function acquire($blocking = true, $timeout = null) | ||
{ | ||
return $this->_self->acquire($blocking, $timeout); | ||
} | ||
|
||
public function release($n = 1) | ||
{ | ||
return $this->_self->release($n); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
namespace python\threading; | ||
|
||
/** | ||
*/ | ||
class ThreadError | ||
{ | ||
private $_self; | ||
|
||
public function __construct() | ||
{ | ||
$this->_self = \PyCore::import('threading')->ThreadError(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
namespace python\threading; | ||
|
||
/** | ||
* @property $daemon | ||
* @property $ident | ||
* @property $name | ||
* @property $native_id | ||
*/ | ||
class Timer | ||
{ | ||
private $_self; | ||
|
||
public function __construct($interval, $function, $args = null, $kwargs = null) | ||
{ | ||
$this->_self = \PyCore::import('threading')->Timer($interval, $function, $args, $kwargs); | ||
} | ||
|
||
public function cancel() | ||
{ | ||
return $this->_self->cancel(); | ||
} | ||
|
||
public function getName() | ||
{ | ||
return $this->_self->getName(); | ||
} | ||
|
||
public function isDaemon() | ||
{ | ||
return $this->_self->isDaemon(); | ||
} | ||
|
||
public function is_alive() | ||
{ | ||
return $this->_self->is_alive(); | ||
} | ||
|
||
public function join($timeout = null) | ||
{ | ||
return $this->_self->join($timeout); | ||
} | ||
|
||
public function run() | ||
{ | ||
return $this->_self->run(); | ||
} | ||
|
||
public function setDaemon($daemonic) | ||
{ | ||
return $this->_self->setDaemon($daemonic); | ||
} | ||
|
||
public function setName($name) | ||
{ | ||
return $this->_self->setName($name); | ||
} | ||
|
||
public function start() | ||
{ | ||
return $this->_self->start(); | ||
} | ||
|
||
} |
Oops, something went wrong.