downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

Thread::join> <Thread::isTerminated
[edit] Last updated: Fri, 17 May 2013

view this page in

Thread::isWaiting

(PECL pthreads >= 0.34)

Thread::isWaitingState Detection

Descripción

final public boolean Thread::isWaiting ( void )

Tell if the referenced Thread is waiting for notification

Parámetros

Esta función no tiene parámetros.

Valores devueltos

A boolean indication of state

Ejemplos

Ejemplo #1 Detect the state of the referenced Thread

<?php
class My extends Thread {
    public function 
run() {
        
$this->synchronized(function($thread){
            
$thread->wait();
        }, 
$this);
    }
}
$my = new My();
$my->start();
$my->synchronized(function($thread){
    
var_dump($thread->isWaiting());
    
$thread->notify();
}, 
$my);
?>

El resultado del ejemplo sería:

bool(true)



add a note add a note User Contributed Notes Thread::isWaiting - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites