Thread::kill

(PECL pthreads < 3.0.0)

Thread::kill执行

Warning

pthreads v3 中已移除此方法。

说明

public Thread::kill ( void ) : void

强制线程中止

Warning

通常情况下,程序员不应该强制杀除线程

参数

此函数没有参数。

返回值

布尔值,表示操作成功与否

范例

Example #1 杀除线程

<?php
class extends Thread {
    public function 
run() {
        
$stdin fopen("php://stdin""r");
        while((
$line fgets($stdin))) {
            echo 
$line;
        }
    }
}

$t = new T();
$t->start();

var_dump($t->kill());
?>

以上例程会输出:

bool(true)