« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 10 of about 98 for thread (0.004 sec.)
zend_thread_id — 現在のスレッドの一意な ID を返す | PHP 8.3 9604
zend_thread_id (PHP 5, PHP 7, PHP 8) zend_thread_id — 現在のスレッドの一意な ID を返す 説明 function zend_thread_id (): int この関数は、現在のスレッドの一意な ID を返します。 パラメータ この関数にはパラメータはありません。 戻り値 スレッドの ... ID を表す整数値を返します。 例 例1 zend_thread_id() の例 <?php $thread_id = zend_thread_id (); echo 'Current thread id is: ' . $thread_id ; ?> 上の例の出力は、 たとえば以 ... 下のようになります。 Current thread id is: 7864 注意 注意 : この関数が使用できるのは、PHP を ZTS (Zend Thread Safety) サポートつきのデバッグモード ( --enable- ... debug ) でビルドした場合のみです。 他のマニュアルの関連ページ Linux JM gettid(2) Linux JM set_thread_area(2) Linux JM get_thread_area(2) Linux JM pthread_self(3) Linux JM pthread_join(3) Python threading ...
https://man.mtool.work/php/8.3/function.zend-thread-id.html
Thread::isJoined — 状態を検出する | PHP 8.3 9604
Thread::isJoined (PECL pthreads >= 2.0.0) Thread::isJoined — 状態を検出する 説明 public function Thread::isJoined (): bool このスレッドが同期されているかどうかを調べます。 パラメータ この関数にはパラメータはありません。 戻り値 成功した場合に ... true を、失敗した場合に false を返します。 例 例1 スレッドの状態を検出する <?php class My extends Thread { public function run () { $this -> synchronized (function( $thread ){ if (! $thread -> done ) $thread -> wait (); }, $thi ... s ); } } $my = new My (); $my -> start (); var_dump ( $my -> isJoined ()); $my -> synchronized (function( $thread ){ $thread -> done = true ; $thread -> notify (); }, $my ); ?> 上の例の出力は以下となります。 bool(false) 他のマニュアルの ... 関連ページ Linux JM set_thread_area(2) Linux JM get_thread_area(2) Linux JM pthread_join(3) Linux JM gettid(2) Linux JM pthread_self(3) Python threading ...
https://man.mtool.work/php/8.3/thread.isjoined.html
Thread::getCurrentThread — Identification | PHP 8.3 9539
Thread::getCurrentThread (PECL pthreads >= 2.0.0) Thread::getCurrentThread — Identification 説明 public static function Thread::getCurrentThread (): Thread Return a reference to the currently executing Thread パラメータ この関数にはパラメー ... タはありません。 戻り値 An object representing the currently executing Thread 例 例1 Return the currently executing Thread <?php class My extends Thread { public function run () { var_dump ( Thread :: ... getCurrentThread ()); } } $my = new My (); $my -> start (); ?> 上の例の出力は以下となります。 object(My)#2 (0) { } ...
https://man.mtool.work/php/8.3/thread.getcurrentthread.html
Threaded::notify — Synchronization | PHP 8.3 9539
Threaded::notify (PECL pthreads >= 2.0.0) Threaded::notify — Synchronization 説明 public function Threaded::notify (): bool Send notification to the referenced object パラメータ この関数にはパラメータはありません。 戻り値 成功した場合に tru ... e を、失敗した場合に false を返します。 例 例1 Notifications and Waiting <?php class My extends Thread { public function run () { /** cause this thread to wait **/ $this -> synchronized (function( $thread ){ if (! $thread -> ... done ) $thread -> wait (); }, $this ); } } $my = new My (); $my -> start (); /** send notification to the waiting thread **/ $my -> synch ... ronized (function( $thread ){ $thread -> done = true ; $thread -> notify (); }, $my ); var_dump ( $my -> join ()); ?> 上の例の出力は以下となります。 ...
https://man.mtool.work/php/8.3/threaded.notify.html
Threaded::wait — Synchronization | PHP 8.3 9539
Threaded::wait (PECL pthreads >= 2.0.0) Threaded::wait — Synchronization 説明 public function Threaded::wait ( int $timeout = ? ): bool Will cause the calling context to wait for notification from the referenced object パラメータ timeout An ... s 戻り値 成功した場合に true を、失敗した場合に false を返します。 例 例1 Notifications and Waiting <?php class My extends Thread { public function run () { /** cause this thread to wait **/ $this -> synchronized (function( $thread ){ if (! $thread -> ... done ) $thread -> wait (); }, $this ); } } $my = new My (); $my -> start (); /** send notification to the waiting thread **/ $my -> synch ... ronized (function( $thread ){ $thread -> done = true ; $thread -> notify (); }, $my ); var_dump ( $my -> join ()); ?> 上の例の出力は以下となります。 ...
https://man.mtool.work/php/8.3/threaded.wait.html
Threaded::notifyOne — Synchronization | PHP 8.3 9513
Threaded::notifyOne (PECL pthreads >= 3.0.0) Threaded::notifyOne — Synchronization 説明 public function Threaded::notifyOne (): bool Send notification to the referenced object. This unblocks at least one of the blocked threads (as opposed t ... o unblocking all of them, as seen with Threaded::notify() ). パラメータ この関数にはパラメータはありません。 戻り値 成功した場合に true を、失敗した場合に false を返しま ... す。 例 例1 Notifications and Waiting <?php class My extends Thread { public function run () { /** cause this thread to wait **/ $this -> synchronized (function( $thread ){ if (! $thread -> ... done ) $thread -> wait (); }, $this ); } } $my = new My (); $my -> start (); /** send notification to the waiting thread **/ $my -> synch ...
https://man.mtool.work/php/8.3/threaded.notifyone.html
Thread::getCurrentThreadId — Identification | PHP 8.3 9473
Thread::getCurrentThreadId (PECL pthreads >= 2.0.0) Thread::getCurrentThreadId — Identification 説明 public static function Thread::getCurrentThreadId (): int Will return the identity of the currently executing Thread パラメータ この関数には ... パラメータはありません。 戻り値 A numeric identity 例 例1 Return the identity of the currently executing Thread <?php class My extends Thread { public function run () { printf ( "%s is Thread #%lu\n" , __CLASS__ , Thread :: getCurrent ... ThreadId ()); } } $my = new My (); $my -> start (); ?> 上の例の出力は以下となります。 My is Thread #123456778899 他のマニュアルの関連ページ Linux JM ftok(3) ...
https://man.mtool.work/php/8.3/thread.getcurrentthreadid.html
Threaded::synchronized — Synchronization | PHP 8.3 9473
Threaded::synchronized (PECL pthreads >= 2.0.0) Threaded::synchronized — Synchronization 説明 public function Threaded::synchronized ( Closure $block , mixed ...$args ): mixed Executes the block while retaining the referenced objects synchr ... use as function arguments to the block 戻り値 The return value from the block 例 例1 Synchronizing <?php class My extends Thread { public function run () { $this -> synchronized (function( $thread ){ if (! $thread -> done ) $thread -> wait (); }, $thi ... s ); } } $my = new My (); $my -> start (); $my -> synchronized (function( $thread ){ $thread -> done = true ; $thread -> notify (); }, $my ); var_dump ( $my -> join ()); ?> 上の例の出力は以下となります。 ... bool(true) 他のマニュアルの関連ページ Linux JM wait(2) Linux JM get_thread_area(2) Linux JM set_thread_area(2) Linux JM pthread_sigmask(3) Python _thread Python threading ...
https://man.mtool.work/php/8.3/threaded.synchronized.html
Thread クラス | PHP 8.3 9447
Thread クラス (PECL pthreads >= 2.0.0) はじめに このオブジェクトの start メソッドが呼ばれると、run メソッドのコードが個別のスレッドで並列処理されます。 run メソッドの実行後は Thread はすぐに終了し、作成元のスレッドに適切な時期に join します ... 。 警告 Thread をいつ join させるのかをエンジンに決めさせていると、予期せぬ振る舞いを引き起こすことがあります。 可能な限り、プログラマーが ... 明示的に指定するようにしましょう。 クラス概要 class Thread extends Threaded implements Countable , Traversable , ArrayAccess { /* メソッド */ public function getCreatorId (): int pu ... blic static function getCurrentThread (): Thread public static function getCurrentThreadId (): int public function getThreadId (): int public function isJoined ...
https://man.mtool.work/php/8.3/class.thread.html
mysqli::$thread_id — 現在の接続のスレッド ID を返す | PHP 8.3 9447
mysqli::$thread_id mysqli_thread_id (PHP 5, PHP 7, PHP 8) mysqli::$thread_id -- mysqli_thread_id — 現在の接続のスレッド ID を返す 説明 オブジェクト指向型 int $mysqli->thread_id ; 手続き型 function mysqli_thread_id ( mysqli $mysql ): int mys ... qli_thread_id() 関数は、現在の接続の スレッド ID を返します。この ID を使用すると、 mysqli_kill() 関数でセッションを切断することが可能 ... _connect() あるいは mysqli_init() が返す mysqli オブジェクト。 戻り値 現在の接続のスレッド ID を返します。 例 例1 $mysqli->thread_id の例 オブジェクト指向型 <?php $mysqli = new mysqli ( "localhost" , "my_user" , "my_password" , "world" ); /* 接続状況を ... _connect_errno ()) { printf ( "Connect failed: %s\n" , mysqli_connect_error ()); exit(); } /* スレッド ID を取得します */ $thread_id = $mysqli -> thread_id ; /* 接続を切断します */ $mysqli -> kill ( $thread_id ); /* これはエラーとなります */ if (! $mys ...
https://man.mtool.work/php/8.3/mysqli.thread-id.html
PREV 1 2 3 4 5 6 7 8 9 10 NEXT