mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-05 11:27:07 +00:00
pthreads 0.1.0 and Thread::kill(). Needs fix
This commit is contained in:
parent
b7cf5d08cc
commit
ac8f2646a7
@ -47,6 +47,9 @@ class ConsoleAPI{
|
||||
if(!defined("NO_THREADS")){
|
||||
$this->loop->stop();
|
||||
$this->loop->notify();
|
||||
//@fclose($this->loop->fp);
|
||||
usleep(50000);
|
||||
$this->loop->kill();
|
||||
//$this->loop->join();
|
||||
}
|
||||
}
|
||||
@ -294,7 +297,7 @@ class ConsoleLoop extends Thread{
|
||||
public $stop;
|
||||
public $base;
|
||||
public $ev;
|
||||
public $fp;
|
||||
public $fp;
|
||||
public function __construct(){
|
||||
$this->line = false;
|
||||
$this->stop = false;
|
||||
@ -319,7 +322,7 @@ class ConsoleLoop extends Thread{
|
||||
|
||||
public function run(){
|
||||
if(!extension_loaded("readline")){
|
||||
$this->fp = fopen( "php://stdin", "r" );
|
||||
$this->fp = fopen("php://stdin", "r");
|
||||
}
|
||||
|
||||
while($this->stop === false){
|
||||
@ -328,7 +331,7 @@ class ConsoleLoop extends Thread{
|
||||
$this->line = false;
|
||||
}
|
||||
|
||||
if(!$this->haveReadline){
|
||||
if(!extension_loaded("readline")){
|
||||
@fclose($fp);
|
||||
}
|
||||
exit(0);
|
||||
|
@ -1,12 +1,12 @@
|
||||
#!/bin/bash
|
||||
COMPILER_VERSION="0.14"
|
||||
COMPILER_VERSION="0.15"
|
||||
|
||||
PHP_VERSION="5.5.8"
|
||||
ZEND_VM="GOTO"
|
||||
|
||||
LIBEDIT_VERSION="0.3"
|
||||
ZLIB_VERSION="1.2.8"
|
||||
PTHREADS_VERSION="0.0.45"
|
||||
PTHREADS_VERSION="0.1.0"
|
||||
CURL_VERSION="curl-7_34_0"
|
||||
|
||||
echo "[PocketMine] PHP installer and compiler for Linux & Mac"
|
||||
|
@ -54,6 +54,11 @@ if(!extension_loaded("sockets") and @dl((PHP_SHLIB_SUFFIX === "dll" ? "php_":"")
|
||||
if(!extension_loaded("pthreads") and @dl((PHP_SHLIB_SUFFIX === "dll" ? "php_":"") . "pthreads." . PHP_SHLIB_SUFFIX) === false){
|
||||
console("[ERROR] Unable to find the pthreads extension.", true, true, 0);
|
||||
++$errors;
|
||||
}else{
|
||||
if(version_compare(phpversion("pthreads"), "0.1.0") < 0){
|
||||
console("[ERROR] pthreads >= 0.1.0 is required.", true, true, 0);
|
||||
++$errors;
|
||||
}
|
||||
}
|
||||
|
||||
if(!extension_loaded("curl") and @dl((PHP_SHLIB_SUFFIX === "dll" ? "php_":"") . "curl." . PHP_SHLIB_SUFFIX) === false){
|
||||
|
@ -55,6 +55,8 @@ class RCON{
|
||||
for($n = 0; $n < $this->threads; ++$n){
|
||||
$this->workers[$n]->close();
|
||||
$this->workers[$n]->join();
|
||||
usleep(50000);
|
||||
$this->workers[$n]->kill();
|
||||
}
|
||||
@socket_close($this->socket);
|
||||
$this->threads = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user