Updated the compile script

This commit is contained in:
Shoghi Cervantes Pueyo 2013-03-22 13:51:53 +01:00
parent 59763a35c7
commit 2a8c72dfc2
4 changed files with 13 additions and 23 deletions

View file

@ -26,9 +26,6 @@ the Free Software Foundation, either version 3 of the License, or
*/
class Async extends Thread {
/**
* Provide a passthrough to call_user_func_array
**/
public function __construct($method, $params = array()){
$this->method = $method;
$this->params = $params;
@ -36,9 +33,6 @@ class Async extends Thread {
$this->joined = false;
}
/**
* The smallest thread in the world
**/
public function run(){
if(($this->result=call_user_func_array($this->method, $this->params))){
return true;
@ -47,21 +41,15 @@ class Async extends Thread {
}
}
/**
* Static method to create your threads from functions ...
**/
public static function call($method, $params = array()){
$thread = new Async($method, $params);
if($thread->start()){
return $thread;
} /** else throw Nastyness **/
}
}
/**
* Do whatever, result stored in $this->result, don't try to join twice
**/
public function __toString(){
if(!$this->joined) {
if(!$this->joined){
$this->joined = true;
$this->join();
}