1
0
mirror of https://github.com/php/doc-zh.git synced 2026-03-23 22:52:08 +01:00
Files
archived-doc-zh/reference/pthreads/worker/stack.xml

84 lines
2.0 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 1f3517218031b663f773061056a873cf2a03f32d Maintainer: yuanyuqiang Status: ready -->
<!-- Reviewed: no -->
<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>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>int</type><methodname>Worker::stack</methodname>
<methodparam><type>Threaded</type><parameter role="reference">work</parameter></methodparam>
</methodsynopsis>
<para>
将要执行的任务入栈到 Worker 对象
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>work</parameter></term>
<listitem>
<para>
要被 Worker 执行的 <classname>Threaded</classname> 派生对象
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
入栈之后Worker 对象栈的大小。
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<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>
<![CDATA[
int(1)
]]>
</screen>
</example>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->