mutex.html
来自「perl教程」· HTML 代码 · 共 136 行
HTML
136 行
<?xml version="1.0" ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<!-- saved from url=(0017)http://localhost/ -->
<script language="JavaScript" src="../../displayToc.js"></script>
<script language="JavaScript" src="../../tocParas.js"></script>
<script language="JavaScript" src="../../tocTab.js"></script>
<link rel="stylesheet" type="text/css" href="../../scineplex.css">
<title>Win32::Mutex - Use Win32 mutex objects from Perl</title>
<link rel="stylesheet" href="../../Active.css" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:" />
</head>
<body>
<script>writelinks('__top__',2);</script>
<h1><a>Win32::Mutex - Use Win32 mutex objects from Perl</a></h1>
<p><a name="__index__"></a></p>
<!-- INDEX BEGIN -->
<ul>
<li><a href="#name">NAME</a></li>
<li><a href="#synopsis">SYNOPSIS</a></li>
<li><a href="#description">DESCRIPTION</a></li>
<ul>
<li><a href="#methods">Methods</a></li>
<li><a href="#deprecated_functions_and_methods">Deprecated Functions and Methods</a></li>
</ul>
<li><a href="#author">AUTHOR</a></li>
</ul>
<!-- INDEX END -->
<hr />
<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>Win32::Mutex - Use Win32 mutex objects from Perl</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<pre>
<span class="keyword">require</span> <span class="variable">Win32::Mutex</span><span class="operator">;</span>
</pre>
<pre>
<span class="variable">$mutex</span> <span class="operator">=</span> <span class="variable">Win32::Mutex</span><span class="operator">-></span><span class="variable">new</span><span class="operator">(</span><span class="variable">$initial</span><span class="operator">,</span><span class="variable">$name</span><span class="operator">);</span>
<span class="variable">$mutex</span><span class="operator">-></span><span class="keyword">wait</span><span class="operator">;</span>
</pre>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>This module allows access to the Win32 mutex objects. The <a href="#item_wait"><code>wait</code></a>
method and <code>wait_all</code> & <code>wait_any</code> functions are inherited from the
<a href="#win32__ipc">Win32::IPC</a> module.</p>
<p>
</p>
<h2><a name="methods">Methods</a></h2>
<dl>
<dt><strong><a name="item_new">$mutex = Win32::Mutex->new([$initial, [$name]])</a></strong>
<dd>
<p>Constructor for a new mutex object. If <code>$initial</code> is true, requests
immediate ownership of the mutex (default false). If <code>$name</code> is
omitted, creates an unnamed mutex object.</p>
</dd>
<dd>
<p>If <code>$name</code> signifies an existing mutex object, then <code>$initial</code> is
ignored and the object is opened. If this happens, <a href="../../lib/Pod/perlvar.html#item___e"><code>$^E</code></a> will be set
to 183 (ERROR_ALREADY_EXISTS).</p>
</dd>
</li>
<dt><strong><a name="item_open">$mutex = Win32::Mutex-><code>open($name)</code></a></strong>
<dd>
<p>Constructor for opening an existing mutex object.</p>
</dd>
</li>
<dt><strong><a name="item_release">$mutex->release</a></strong>
<dd>
<p>Release ownership of a <code>$mutex</code>. You should have obtained ownership
of the mutex through <a href="#item_new"><code>new</code></a> or one of the wait functions. Returns
true if successful.</p>
</dd>
</li>
<dt><strong><a name="item_wait">$mutex-><code>wait([$timeout])</code></a></strong>
<dd>
<p>Wait for ownership of <code>$mutex</code>. See <a href="#win32__ipc">Win32::IPC</a>.</p>
</dd>
</li>
</dl>
<p>
</p>
<h2><a name="deprecated_functions_and_methods">Deprecated Functions and Methods</a></h2>
<p><strong>Win32::Mutex</strong> still supports the ActiveWare syntax, but its use is
deprecated.</p>
<dl>
<dt><strong><a name="item_create"><code>Create($MutObj,$Initial,$Name)</code></a></strong>
<dd>
<p>Use <a href="#item_new"><code>$MutObj = Win32::Mutex->new($Initial,$Name)</code></a> instead.</p>
</dd>
</li>
<dt><strong><a name="item_open"><code>Open($MutObj,$Name)</code></a></strong>
<dd>
<p>Use <a href="#item_open"><code>$MutObj = Win32::Mutex->open($Name)</code></a> instead.</p>
</dd>
</li>
<dt><strong><a name="item_release">$MutObj-><code>Release()</code></a></strong>
<dd>
<p>Use <a href="#item_release"><code>$MutObj->release</code></a> instead.</p>
</dd>
</li>
</dl>
<p>
</p>
<hr />
<h1><a name="author">AUTHOR</a></h1>
<p>Christopher J. Madsen <<em><a href="mailto:cjm@pobox.com">cjm@pobox.com</a></em>></p>
<p>Loosely based on the original module by ActiveWare Internet Corp.,
<em><a href="http://www.ActiveWare.com">http://www.ActiveWare.com</a></em></p>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?