uTools-Manuals/docs/php/pcntl_getpriority.html
2019-04-08 23:22:26 +08:00

89 lines
3.5 KiB
HTML
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.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>获取任意进程的优先级</title>
</head>
<body class="docs"><div id="layout">
<div id="layout-content"><div id="function.pcntl-getpriority" class="refentry">
<div class="refnamediv">
<h1 class="refname">pcntl_getpriority</h1>
<p class="verinfo">(PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">pcntl_getpriority</span> &mdash; <span class="dc-title">获取任意进程的优先级</span></p>
</div>
<div class="refsect1 description" id="refsect1-function.pcntl-getpriority-description">
<h3 class="title">说明</h3>
<div class="methodsynopsis dc-description">
<span class="methodname"><strong>pcntl_getpriority</strong></span>
([ <span class="methodparam"><span class="type">int</span> <code class="parameter">$pid</code><span class="initializer"> = getmypid()</span></span>
[, <span class="methodparam"><span class="type">int</span> <code class="parameter">$process_identifier</code><span class="initializer"> = PRIO_PROCESS</span></span>
]] ) : <span class="type">int</span></div>
<p class="para rdfs-comment">
<span class="function"><strong>pcntl_getpriority()</strong></span> 获取进程号为
<code class="parameter">pid</code>的进程的优先级。由于不同的系统类型以及内核版本下
优先级可能不同因此请参考您系统的getpriority2手册以获取详细的规范。
</p>
</div>
<div class="refsect1 parameters" id="refsect1-function.pcntl-getpriority-parameters">
<h3 class="title">参数</h3>
<p class="para">
<dl>
<dt>
<code class="parameter">pid</code></dt>
<dd>
<p class="para">
如果没有指定,默认是当前进程的进程号。
</p>
</dd>
<dt>
<code class="parameter">process_identifier</code></dt>
<dd>
<p class="para">
<strong><code>PRIO_PGRP</code></strong>(译注:获取进程组优先级), <strong><code>PRIO_USER</code></strong>
(译注:获取用户进程优先级)或 <strong><code>PRIO_PROCESS译注默认值;获取进程优先级)</code></strong>三者之一。
</p>
</dd>
</dl>
</p>
</div>
<div class="refsect1 returnvalues" id="refsect1-function.pcntl-getpriority-returnvalues">
<h3 class="title">返回值</h3>
<p class="para">
<span class="function"><strong>pcntl_getpriority()</strong></span> 返回进程的优先级或在错误时返回 <strong><code>FALSE</code></strong> 。 值越小代表优先级越高。
</p>
<div class="warning"><strong class="warning">Warning</strong><p class="simpara">此函数可能返回布尔值
<strong><code>FALSE</code></strong>,但也可能返回等同于 <strong><code>FALSE</code></strong> 的非布尔值。请阅读 <a href="language.types.boolean.html" class="link">布尔类型</a>章节以获取更多信息。应使用
<a href="language.operators.comparison.html" class="link">===
运算符</a>来测试此函数的返回值。</p></div>
</div>
<div class="refsect1 seealso" id="refsect1-function.pcntl-getpriority-seealso">
<h3 class="title">参见</h3>
<p class="para">
<ul class="simplelist">
<li class="member"><span class="function"><a href="pcntl_setpriority.html" class="function" rel="rdfs-seeAlso">pcntl_setpriority()</a> - 修改任意进程的优先级</span></li>
</ul>
</p>
</div>
</div></div></div></body></html>