mirror of
https://github.com/php/doc-zh.git
synced 2026-03-23 22:52:08 +01:00
pthreads: fix XML to remove useless wrapping para tags via script
This commit is contained in:
@@ -1,115 +1,112 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 86e6094e86b84a51d00ab217ac50ce8dde33d82a Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- CREDITS: mowangjuanzi -->
|
||||
<appendix xml:id="pthreads.constants" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<appendix xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="pthreads.constants">
|
||||
&reftitle.constants;
|
||||
&extension.constants;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry xml:id="constant.pthreads-inherit-all">
|
||||
<term>
|
||||
<constant>PTHREADS_INHERIT_ALL</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
线程的默认选项。线程开始的时候,pthreads 扩展会将环境复制到线程上下文中。
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.pthreads-inherit-none">
|
||||
<term>
|
||||
<constant>PTHREADS_INHERIT_NONE</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
新线程开始时,不继承任何内容。
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.pthreads-inherit-ini">
|
||||
<term>
|
||||
<constant>PTHREADS_INHERIT_INI</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
新线程开始时,仅继承 INI 配置。
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.pthreads-inherit-constants">
|
||||
<term>
|
||||
<constant>PTHREADS_INHERIT_CONSTANTS</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
新线程开始时,继承用户定义的常量。
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.pthreads-inherit-classes">
|
||||
<term>
|
||||
<constant>PTHREADS_INHERIT_CLASSES</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
新线程开始时,继承用户定义的类。
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.pthreads-inherit-functions">
|
||||
<term>
|
||||
<constant>PTHREADS_INHERIT_FUNCTIONS</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
新线程开始时,继承用户定义的函数。
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.pthreads-inherit-includes">
|
||||
<term>
|
||||
<constant>PTHREADS_INHERIT_INCLUDES</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
新线程开始时,继承包含文件。
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.pthreads-inherit-comments">
|
||||
<term>
|
||||
<constant>PTHREADS_INHERIT_COMMENTS</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
新线程开始时,继承所有的注释。
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.pthreads-allow-headers">
|
||||
<term>
|
||||
<constant>PTHREADS_ALLOW_HEADERS</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
允许新线程向标准输出发送头信息(通常情况下是被禁止的)。
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
<variablelist>
|
||||
<varlistentry xml:id="constant.pthreads-inherit-all">
|
||||
<term>
|
||||
<constant>PTHREADS_INHERIT_ALL</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
线程的默认选项。线程开始的时候,pthreads 扩展会将环境复制到线程上下文中。
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.pthreads-inherit-none">
|
||||
<term>
|
||||
<constant>PTHREADS_INHERIT_NONE</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
新线程开始时,不继承任何内容。
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.pthreads-inherit-ini">
|
||||
<term>
|
||||
<constant>PTHREADS_INHERIT_INI</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
新线程开始时,仅继承 INI 配置。
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.pthreads-inherit-constants">
|
||||
<term>
|
||||
<constant>PTHREADS_INHERIT_CONSTANTS</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
新线程开始时,继承用户定义的常量。
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.pthreads-inherit-classes">
|
||||
<term>
|
||||
<constant>PTHREADS_INHERIT_CLASSES</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
新线程开始时,继承用户定义的类。
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.pthreads-inherit-functions">
|
||||
<term>
|
||||
<constant>PTHREADS_INHERIT_FUNCTIONS</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
新线程开始时,继承用户定义的函数。
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.pthreads-inherit-includes">
|
||||
<term>
|
||||
<constant>PTHREADS_INHERIT_INCLUDES</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
新线程开始时,继承包含文件。
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.pthreads-inherit-comments">
|
||||
<term>
|
||||
<constant>PTHREADS_INHERIT_COMMENTS</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
新线程开始时,继承所有的注释。
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.pthreads-allow-headers">
|
||||
<term>
|
||||
<constant>PTHREADS_ALLOW_HEADERS</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
允许新线程向标准输出发送头信息(通常情况下是被禁止的)。
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</appendix>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 0545e305cf06937b14b3f0694d6e716c9881ffd7 Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- CREDITS: Luffy -->
|
||||
<refentry xml:id="pool.collect" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="pool.collect">
|
||||
<refnamediv>
|
||||
<refname>Pool::collect</refname>
|
||||
<refpurpose>回收已完成任务的引用</refpurpose>
|
||||
@@ -43,36 +43,33 @@
|
||||
|
||||
<refsect1 role="changelog">
|
||||
&reftitle.changelog;
|
||||
<para>
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>&Version;</entry>
|
||||
<entry>&Description;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>PECL pthreads 3.0.0</entry>
|
||||
<entry>
|
||||
<parameter>collector</parameter> 参数变为可选参数,
|
||||
并且返回值改为整数。
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</para>
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>&Version;</entry>
|
||||
<entry>&Description;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>PECL pthreads 3.0.0</entry>
|
||||
<entry>
|
||||
<parameter>collector</parameter> 参数变为可选参数,
|
||||
并且返回值改为整数。
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</refsect1>
|
||||
|
||||
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><methodname>Pool::collect</methodname> 基本用法示例</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title><methodname>Pool::collect</methodname> 基本用法示例</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$pool = new Pool(4);
|
||||
@@ -85,13 +82,11 @@ while ($pool->collect()); // 直到全部的任务都完成执行之后才会继
|
||||
|
||||
$pool->shutdown();
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: c44e9cb68b9b65771f9c45db2c07a06c63d71359 Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- CREDITS: mowangjuanzi -->
|
||||
<refentry xml:id="pool.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="pool.construct">
|
||||
<refnamediv>
|
||||
<refname>Pool::__construct</refname>
|
||||
<refpurpose>创建新的 Worker 对象池</refpurpose>
|
||||
@@ -56,18 +56,17 @@
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>创建 Pool 对象</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>创建 Pool 对象</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class MyWorker extends Worker {
|
||||
|
||||
|
||||
public function __construct(Something $something) {
|
||||
$this->something = $something;
|
||||
}
|
||||
|
||||
|
||||
public function run() {
|
||||
/** ... **/
|
||||
}
|
||||
@@ -78,9 +77,9 @@ $pool = new Pool(8, \MyWorker::class, [new Something()]);
|
||||
var_dump($pool);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
object(Pool)#1 (6) {
|
||||
["size":protected]=>
|
||||
@@ -101,13 +100,11 @@ object(Pool)#1 (6) {
|
||||
int(0)
|
||||
}
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 7febeefab69aa2920922de7adfe17724148d0b60 Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
<!-- CREDITS: Luffy -->
|
||||
|
||||
<refentry xml:id="pool.shutdown" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="pool.shutdown">
|
||||
<refnamediv>
|
||||
<refname>Pool::shutdown</refname>
|
||||
<refpurpose>停止所有的 Worker 对象</refpurpose>
|
||||
@@ -36,10 +35,9 @@
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>完全停止一个 Pool</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>完全停止一个 Pool</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class Task extends Threaded
|
||||
@@ -58,12 +56,10 @@ for ($i = 0; $i < 10; ++$i) {
|
||||
|
||||
$pool->shutdown(); // 进入阻塞状态,直到所有已经提交到 Pool 中的任务都执行完毕
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1bae6f9b269029bed8f67f97af2f695ed41ff3ea Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
|
||||
<refentry xml:id="pool.submit" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="pool.submit">
|
||||
<refnamediv>
|
||||
<refname>Pool::submit</refname>
|
||||
<refpurpose>提交对象以执行</refpurpose>
|
||||
@@ -43,25 +42,24 @@
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>提交任务</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>提交任务</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class MyWork extends Threaded {
|
||||
|
||||
|
||||
public function run() {
|
||||
/* ... */
|
||||
}
|
||||
}
|
||||
|
||||
class MyWorker extends Worker {
|
||||
|
||||
|
||||
public function __construct(Something $something) {
|
||||
$this->something = $something;
|
||||
}
|
||||
|
||||
|
||||
public function run() {
|
||||
/** ... **/
|
||||
}
|
||||
@@ -72,9 +70,9 @@ $pool->submit(new MyWork());
|
||||
var_dump($pool);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
object(Pool)#1 (6) {
|
||||
["size":protected]=>
|
||||
@@ -112,13 +110,11 @@ object(Pool)#1 (6) {
|
||||
int(1)
|
||||
}
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: b694084174d9bb9432d5ae0d405e43482e6cfb67 Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
|
||||
<refentry xml:id="pool.submitTo" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="pool.submitTo">
|
||||
<refnamediv>
|
||||
<refname>Pool::submitTo</refname>
|
||||
<refpurpose>提交一个任务到特定的 Worker 以执行</refpurpose>
|
||||
@@ -54,10 +53,9 @@
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>提交任务到特定的 Worker</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>提交任务到特定的 Worker</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class Task extends Threaded {
|
||||
@@ -78,9 +76,9 @@ $pool->submitTo(1, new Task()); // 由于第二个 Worker 尚未存在,所以
|
||||
|
||||
$pool->shutdown();
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
int(4475011072)
|
||||
int(4475011072)
|
||||
@@ -91,13 +89,11 @@ int(4475011072)
|
||||
|
||||
Fatal error: Uncaught Exception: The selected worker (1) does not exist in %s:%d
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: ad2e71299d249c84ab5a0420aeb548e66f699a13 Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
|
||||
<refentry xml:id="thread.getcreatorid" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="thread.getcreatorid">
|
||||
<refnamediv>
|
||||
<refname>Thread::getCreatorId</refname>
|
||||
<refpurpose>识别</refpurpose>
|
||||
@@ -34,10 +33,9 @@
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>返回创建线程的线程或进程ID</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>返回创建线程的线程或进程ID</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class My extends Thread {
|
||||
@@ -49,19 +47,17 @@ $my = new My();
|
||||
$my->start();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
My created by Thread #123456778899
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 637c29c81a694e3e9f1d6293bd7af230050e5499 Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
|
||||
<refentry xml:id="thread.getcurrentthread" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="thread.getcurrentthread">
|
||||
<refnamediv>
|
||||
<refname>Thread::getCurrentThread</refname>
|
||||
<refpurpose>识别</refpurpose>
|
||||
@@ -13,7 +12,7 @@
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <modifier>static</modifier> <type>Thread</type><methodname>Thread::getCurrentThread</methodname>
|
||||
<void />
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
获取当前执行线程的引用。
|
||||
@@ -30,13 +29,12 @@
|
||||
表示当前执行线程的对象。
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>获取当前执行线程</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>获取当前执行线程</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class My extends Thread {
|
||||
@@ -48,21 +46,19 @@ $my = new My();
|
||||
$my->start();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
object(My)#2 (0) {
|
||||
}
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: ad2e71299d249c84ab5a0420aeb548e66f699a13 Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
|
||||
<refentry xml:id="thread.getcurrentthreadid" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="thread.getcurrentthreadid">
|
||||
<refnamediv>
|
||||
<refname>Thread::getCurrentThreadId</refname>
|
||||
<refpurpose>识别</refpurpose>
|
||||
@@ -13,7 +12,7 @@
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <modifier>static</modifier> <type>int</type><methodname>Thread::getCurrentThreadId</methodname>
|
||||
<void />
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
返回当前执行线程的ID
|
||||
@@ -34,10 +33,9 @@
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>返回当前执行线程的ID</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>返回当前执行线程的ID</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class My extends Thread {
|
||||
@@ -49,19 +47,17 @@ $my = new My();
|
||||
$my->start();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
My is Thread #123456778899
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: ad2e71299d249c84ab5a0420aeb548e66f699a13 Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
|
||||
<refentry xml:id="thread.getthreadid" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="thread.getthreadid">
|
||||
<refnamediv>
|
||||
<refname>Thread::getThreadId</refname>
|
||||
<refpurpose>识别</refpurpose>
|
||||
@@ -13,7 +12,7 @@
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>int</type><methodname>Thread::getThreadId</methodname>
|
||||
<void />
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
返回引用线程的ID
|
||||
@@ -34,10 +33,9 @@
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>返回引用线程的ID</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>返回引用线程的ID</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class My extends Thread {
|
||||
@@ -49,19 +47,17 @@ $my = new My();
|
||||
$my->start();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
My is Thread #123456778899
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 7febeefab69aa2920922de7adfe17724148d0b60 Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
<!-- CREDITS: Luffy -->
|
||||
|
||||
<refentry xml:id="thread.isjoined" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="thread.isjoined">
|
||||
<refnamediv>
|
||||
<refname>Thread::isJoined</refname>
|
||||
<refpurpose>状态监测</refpurpose>
|
||||
@@ -35,10 +34,9 @@
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>检测线程状态</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>检测线程状态</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class My extends Thread {
|
||||
@@ -58,18 +56,16 @@ $my->synchronized(function($thread){
|
||||
}, $my);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
bool(false)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 7febeefab69aa2920922de7adfe17724148d0b60 Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
<!-- CREDITS: Luffy -->
|
||||
|
||||
<refentry xml:id="thread.isstarted" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="thread.isstarted">
|
||||
<refnamediv>
|
||||
<refname>Thread::isStarted</refname>
|
||||
<refpurpose>状态检测</refpurpose>
|
||||
@@ -33,13 +32,12 @@
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>监测线程是否开始执行</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>监测线程是否开始执行</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$worker = new Worker();
|
||||
@@ -47,19 +45,17 @@ $worker->start();
|
||||
var_dump($worker->isStarted());
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
bool(true)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 7febeefab69aa2920922de7adfe17724148d0b60 Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
<!-- CREDITS: Luffy -->
|
||||
|
||||
<refentry xml:id="thread.join" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="thread.join">
|
||||
<refnamediv>
|
||||
<refname>Thread::join</refname>
|
||||
<refpurpose>同步</refpurpose>
|
||||
@@ -35,10 +34,9 @@
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>加入线程</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>加入线程</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class My extends Thread {
|
||||
@@ -53,19 +51,17 @@ var_dump($my->join());
|
||||
/* ... */
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
bool(true)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 7febeefab69aa2920922de7adfe17724148d0b60 Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
<!-- CREDITS: Luffy -->
|
||||
|
||||
<refentry xml:id="thread.start" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="thread.start">
|
||||
<refnamediv>
|
||||
<refname>Thread::start</refname>
|
||||
<refpurpose>执行</refpurpose>
|
||||
@@ -44,10 +43,9 @@
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>开始线程</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>开始线程</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class My extends Thread {
|
||||
@@ -59,19 +57,17 @@ $my = new My();
|
||||
var_dump($my->start());
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
bool(true)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: be295015d068095fc92880baef4e47038646adbd Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
<refentry xml:id="threaded.chunk" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="threaded.chunk">
|
||||
<refnamediv>
|
||||
<refname>Threaded::chunk</refname>
|
||||
<refpurpose>操作</refpurpose>
|
||||
@@ -18,7 +18,7 @@
|
||||
获取给定数量的对象属性表,可以选择是否保留键名称。
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
@@ -34,7 +34,7 @@
|
||||
<term><parameter>preserve</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
保留成员原有的键名称,默认为 false
|
||||
保留成员原有的键名称,默认为 false
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -50,10 +50,9 @@
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>获取对象属性表中的部分条目</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>获取对象属性表中的部分条目</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$safe = new Threaded();
|
||||
@@ -65,9 +64,9 @@ while (count($safe) < 10) {
|
||||
var_dump($safe->chunk(5));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
array(5) {
|
||||
[0]=>
|
||||
@@ -82,13 +81,11 @@ array(5) {
|
||||
int(4)
|
||||
}
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: ad2e71299d249c84ab5a0420aeb548e66f699a13 Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
|
||||
<refentry xml:id="threaded.count" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="threaded.count">
|
||||
<refnamediv>
|
||||
<refname>Threaded::count</refname>
|
||||
<refpurpose>操作</refpurpose>
|
||||
@@ -13,7 +12,7 @@
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>int</type><methodname>Threaded::count</methodname>
|
||||
<void />
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
返回对象的属性数量
|
||||
@@ -29,16 +28,15 @@
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
|
||||
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>计算对象中的属性数量</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>计算对象中的属性数量</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$safe = new Threaded();
|
||||
@@ -50,19 +48,17 @@ while (count($safe) < 10) {
|
||||
var_dump(count($safe));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
int(10)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 331fbfeac522d4ad00de1e043cc11610d66b88f9 Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
|
||||
<refentry xml:id="thread.isrunning" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="thread.isrunning">
|
||||
<refnamediv>
|
||||
<refname>Threaded::isRunning</refname>
|
||||
<refpurpose>状态检测</refpurpose>
|
||||
@@ -13,7 +12,7 @@
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>bool</type><methodname>Threaded::isRunning</methodname>
|
||||
<void />
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
对象是否正在运行
|
||||
@@ -39,10 +38,9 @@
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>检测对象状态</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>检测对象状态</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class My extends Thread {
|
||||
@@ -62,18 +60,16 @@ $my->synchronized(function($thread){
|
||||
}, $my);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
bool(true)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 331fbfeac522d4ad00de1e043cc11610d66b88f9 Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
|
||||
<refentry xml:id="threaded.isterminated" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="threaded.isterminated">
|
||||
<refnamediv>
|
||||
<refname>Threaded::isTerminated</refname>
|
||||
<refpurpose>状态检测</refpurpose>
|
||||
@@ -13,7 +12,7 @@
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>bool</type><methodname>Threaded::isTerminated</methodname>
|
||||
<void />
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
检测是否因致命错误或未捕获的异常而导致执行过程异常终止
|
||||
@@ -34,10 +33,9 @@
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>检测对象状态</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>检测对象状态</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class My extends Thread {
|
||||
@@ -51,18 +49,16 @@ $my->join();
|
||||
var_dump($my->isTerminated());
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
bool(true)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 7febeefab69aa2920922de7adfe17724148d0b60 Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
<!-- CREDITS: Luffy -->
|
||||
|
||||
<refentry xml:id="threaded.merge" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="threaded.merge">
|
||||
<refnamediv>
|
||||
<refname>Threaded::merge</refname>
|
||||
<refpurpose>操作</refpurpose>
|
||||
@@ -56,10 +55,9 @@
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>合并数据到对象的属性表</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>合并数据到对象的属性表</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$array = [];
|
||||
@@ -79,9 +77,9 @@ $safe->merge($stdClass);
|
||||
var_dump($safe);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
object(Threaded)#2 (13) {
|
||||
["0"]=>
|
||||
@@ -112,12 +110,10 @@ object(Threaded)#2 (13) {
|
||||
string(3) "baz"
|
||||
}
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 7febeefab69aa2920922de7adfe17724148d0b60 Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
<!-- CREDITS: Luffy -->
|
||||
|
||||
<refentry xml:id="threaded.notify" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="threaded.notify">
|
||||
<refnamediv>
|
||||
<refname>Threaded::notify</refname>
|
||||
<refpurpose>同步控制</refpurpose>
|
||||
@@ -14,7 +13,7 @@
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>bool</type><methodname>Threaded::notify</methodname>
|
||||
<void />
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
向对象发送唤醒通知
|
||||
@@ -35,10 +34,9 @@
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>等待和唤醒</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>等待和唤醒</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class My extends Thread {
|
||||
@@ -60,18 +58,16 @@ $my->synchronized(function($thread){
|
||||
var_dump($my->join());
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
bool(true)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 0d69739d2c67b351921b44f5cfffe573eacc699c Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- CREDITS: mowangjuanzi -->
|
||||
<refentry xml:id="threaded.pop" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="threaded.pop">
|
||||
<refnamediv>
|
||||
<refname>Threaded::pop</refname>
|
||||
<refpurpose>操作</refpurpose>
|
||||
@@ -12,7 +12,7 @@
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>bool</type><methodname>Threaded::pop</methodname>
|
||||
<void />
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
弹出对象属性表中的最后一项数据
|
||||
@@ -30,13 +30,12 @@
|
||||
对象属性表中最后一项数据
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>弹出对象属性表中的最后一项数据</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>弹出对象属性表中的最后一项数据</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$safe = new Threaded();
|
||||
@@ -47,18 +46,16 @@ while (count($safe) < 10)
|
||||
var_dump($safe->pop());
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
int(9)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 0d69739d2c67b351921b44f5cfffe573eacc699c Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- CREDITS: mowangjuanzi -->
|
||||
<refentry xml:id="threaded.shift" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="threaded.shift">
|
||||
<refnamediv>
|
||||
<refname>Threaded::shift</refname>
|
||||
<refpurpose>Manipulation</refpurpose>
|
||||
@@ -12,7 +12,7 @@
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>boolean</type><methodname>Threaded::shift</methodname>
|
||||
<void />
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
弹出对象属性表中第一项数据
|
||||
@@ -30,13 +30,12 @@
|
||||
对象属性表中的第一项数据
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>弹出对象属性表中第一项数据</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>弹出对象属性表中第一项数据</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$safe = new Threaded();
|
||||
@@ -47,18 +46,16 @@ while (count($safe) < 10)
|
||||
var_dump($safe->shift());
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
int(0)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 9e0f03ac354d797d1d16c0fcc1663e5e170f2727 Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- CREDITS: mowangjuanzi -->
|
||||
<refentry xml:id="threaded.synchronized" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="threaded.synchronized">
|
||||
<refnamediv>
|
||||
<refname>Threaded::synchronized</refname>
|
||||
<refpurpose>同步控制</refpurpose>
|
||||
@@ -51,10 +51,9 @@
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>同步</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>同步</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class My extends Thread {
|
||||
@@ -74,18 +73,16 @@ $my->synchronized(function($thread){
|
||||
var_dump($my->join());
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
bool(true)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 7febeefab69aa2920922de7adfe17724148d0b60 Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
<!-- CREDITS: Luffy -->
|
||||
|
||||
<refentry xml:id="threaded.wait" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="threaded.wait">
|
||||
<refnamediv>
|
||||
<refname>Threaded::wait</refname>
|
||||
<refpurpose>Synchronization</refpurpose>
|
||||
@@ -44,10 +43,9 @@
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>等待和唤醒</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>等待和唤醒</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class My extends Thread {
|
||||
@@ -69,18 +67,16 @@ $my->synchronized(function($thread){
|
||||
var_dump($my->join());
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
bool(true)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 99a05eca30d4789366893e5fd902c6c17d10fba1 Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
|
||||
<refentry xml:id="worker.getstacked" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="worker.getstacked">
|
||||
<refnamediv>
|
||||
<refname>Worker::getStacked</refname>
|
||||
<refpurpose>获取剩余的栈大小</refpurpose>
|
||||
@@ -13,7 +12,7 @@
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>int</type><methodname>Worker::getStacked</methodname>
|
||||
<void />
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
返回栈中剩余的任务数量
|
||||
@@ -34,10 +33,9 @@
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><classname>Worker::getStacked</classname> 基本示例</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title><classname>Worker::getStacked</classname> 基本示例</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$worker = new Worker();
|
||||
@@ -48,18 +46,16 @@ for ($i = 0; $i < 5; ++$i) {
|
||||
|
||||
echo "There are {$worker->getStacked()} stacked tasks\n";
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
There are 5 stacked tasks
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 99a05eca30d4789366893e5fd902c6c17d10fba1 Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
|
||||
<refentry xml:id="worker.isshutdown" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="worker.isshutdown">
|
||||
<refnamediv>
|
||||
<refname>Worker::isShutdown</refname>
|
||||
<refpurpose>状态检测</refpurpose>
|
||||
@@ -13,7 +12,7 @@
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>bool</type><methodname>Worker::isShutdown</methodname>
|
||||
<void />
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Worker 对象是否被关闭
|
||||
@@ -35,10 +34,9 @@
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>检测 Worker 对象状态</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>检测 Worker 对象状态</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$worker = new Worker();
|
||||
@@ -50,20 +48,18 @@ $worker->shutdown();
|
||||
|
||||
var_dump($worker->isShutdown());
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
bool(false)
|
||||
bool(true)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 7febeefab69aa2920922de7adfe17724148d0b60 Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
<!-- CREDITS: Luffy -->
|
||||
|
||||
<refentry xml:id="worker.shutdown" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="worker.shutdown">
|
||||
<refnamediv>
|
||||
<refname>Worker::shutdown</refname>
|
||||
<refpurpose>关闭 Worker </refpurpose>
|
||||
@@ -14,7 +13,7 @@
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>bool</type><methodname>Worker::shutdown</methodname>
|
||||
<void />
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
在执行完已入栈对象之后,关闭这个 Worker 对象
|
||||
@@ -35,10 +34,9 @@
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>关闭 Worker</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>关闭 Worker</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$my = new Worker();
|
||||
@@ -46,18 +44,16 @@ $my->start();
|
||||
/* 入栈和执行任务 */
|
||||
var_dump($my->shutdown());
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
bool(true)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 99a05eca30d4789366893e5fd902c6c17d10fba1 Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- Reviewed: no -->
|
||||
|
||||
<refentry xml:id="worker.stack" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="worker.stack">
|
||||
<refnamediv>
|
||||
<refname>Worker::stack</refname>
|
||||
<refpurpose>将要执行的任务入栈</refpurpose>
|
||||
@@ -43,28 +42,25 @@
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>向 Worker 中入栈任务并执行</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>向 Worker 中入栈任务并执行</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$worker = new Worker();
|
||||
$work = new class extends Threaded {};
|
||||
|
||||
var_dump($worker->stack($work));]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
int(1)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 0545e305cf06937b14b3f0694d6e716c9881ffd7 Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
|
||||
<!-- CREDITS: Luffy -->
|
||||
<refentry xml:id="worker.unstack" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="worker.unstack">
|
||||
<refnamediv>
|
||||
<refname>Worker::unstack</refname>
|
||||
<refpurpose>将要执行的任务出栈</refpurpose>
|
||||
@@ -30,38 +30,35 @@
|
||||
出栈之后,Worker 栈的大小。
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
<refsect1 role="changelog">
|
||||
&reftitle.changelog;
|
||||
<para>
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>&Version;</entry>
|
||||
<entry>&Description;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>PECL pthreads 3.0.0</entry>
|
||||
<entry>
|
||||
移除了要出栈的任务参数。
|
||||
现在只能移除栈顶元素。
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</para>
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>&Version;</entry>
|
||||
<entry>&Description;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>PECL pthreads 3.0.0</entry>
|
||||
<entry>
|
||||
移除了要出栈的任务参数。
|
||||
现在只能移除栈顶元素。
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>从 Worker 栈中移除对象</title>
|
||||
<programlisting role="php">
|
||||
<example>
|
||||
<title>从 Worker 栈中移除对象</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$my = new Worker();
|
||||
@@ -70,19 +67,17 @@ $work = new class extends Threaded {};
|
||||
var_dump($my->stack($work));
|
||||
var_dump($my->unstack());
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
int(1)
|
||||
int(0)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
Reference in New Issue
Block a user