⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 syncthrd_8h-source.html

📁 pwlib开发文档
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>syncthrd.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.18 --><center><a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center><hr><h1>syncthrd.h</h1><a href="syncthrd_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span>00002 <span class="comment"> * syncthrd.h</span>00003 <span class="comment"> *</span>00004 <span class="comment"> * Various thread synchronisation classes.</span>00005 <span class="comment"> *</span>00006 <span class="comment"> * Portable Windows Library</span>00007 <span class="comment"> *</span>00008 <span class="comment"> * Copyright (c) 1993-1998 Equivalence Pty. Ltd.</span>00009 <span class="comment"> *</span>00010 <span class="comment"> * The contents of this file are subject to the Mozilla Public License</span>00011 <span class="comment"> * Version 1.0 (the "License"); you may not use this file except in</span>00012 <span class="comment"> * compliance with the License. You may obtain a copy of the License at</span>00013 <span class="comment"> * http://www.mozilla.org/MPL/</span>00014 <span class="comment"> *</span>00015 <span class="comment"> * Software distributed under the License is distributed on an "AS IS"</span>00016 <span class="comment"> * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See</span>00017 <span class="comment"> * the License for the specific language governing rights and limitations</span>00018 <span class="comment"> * under the License.</span>00019 <span class="comment"> *</span>00020 <span class="comment"> * The Original Code is Portable Windows Library.</span>00021 <span class="comment"> *</span>00022 <span class="comment"> * The Initial Developer of the Original Code is Equivalence Pty. Ltd.</span>00023 <span class="comment"> *</span>00024 <span class="comment"> * Portions are Copyright (C) 1993 Free Software Foundation, Inc.</span>00025 <span class="comment"> * All Rights Reserved.</span>00026 <span class="comment"> *</span>00027 <span class="comment"> * Contributor(s): ______________________________________.</span>00028 <span class="comment"> *</span>00029 <span class="comment"> * $Log: syncthrd.h,v $</span>00030 <span class="comment"> * Revision 1.13  2004/03/22 10:15:27  rjongbloed</span>00031 <span class="comment"> * Added classes similar to PWaitAndSignal to automatically unlock a PReadWriteMutex</span>00032 <span class="comment"> *   when goes out of scope.</span>00033 <span class="comment"> *</span>00034 <span class="comment"> * Revision 1.12  2002/12/11 03:21:28  robertj</span>00035 <span class="comment"> * Updated documentation for read/write mutex.</span>00036 <span class="comment"> *</span>00037 <span class="comment"> * Revision 1.11  2002/10/04 08:20:44  robertj</span>00038 <span class="comment"> * Changed read/write mutex so can be called by same thread without deadlock.</span>00039 <span class="comment"> *</span>00040 <span class="comment"> * Revision 1.10  2002/09/16 01:08:59  robertj</span>00041 <span class="comment"> * Added #define so can select if #pragma interface/implementation is used on</span>00042 <span class="comment"> *   platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.</span>00043 <span class="comment"> *</span>00044 <span class="comment"> * Revision 1.9  2002/05/01 03:45:31  robertj</span>00045 <span class="comment"> * Added initialisation of PreadWriteMutex and changed slightly to agree</span>00046 <span class="comment"> *   with the text book definition of a semaphore for one of the mutexes.</span>00047 <span class="comment"> *</span>00048 <span class="comment"> * Revision 1.8  2002/04/30 06:21:54  robertj</span>00049 <span class="comment"> * Fixed PReadWriteMutex class to implement text book algorithm!</span>00050 <span class="comment"> *</span>00051 <span class="comment"> * Revision 1.7  2001/05/22 12:49:32  robertj</span>00052 <span class="comment"> * Did some seriously wierd rewrite of platform headers to eliminate the</span>00053 <span class="comment"> *   stupid GNU compiler warning about braces not matching.</span>00054 <span class="comment"> *</span>00055 <span class="comment"> * Revision 1.6  1999/03/09 02:59:51  robertj</span>00056 <span class="comment"> * Changed comments to doc++ compatible documentation.</span>00057 <span class="comment"> *</span>00058 <span class="comment"> * Revision 1.5  1999/02/16 08:11:17  robertj</span>00059 <span class="comment"> * MSVC 6.0 compatibility changes.</span>00060 <span class="comment"> *</span>00061 <span class="comment"> * Revision 1.4  1998/11/30 02:52:01  robertj</span>00062 <span class="comment"> * New directory structure</span>00063 <span class="comment"> *</span>00064 <span class="comment"> * Revision 1.3  1998/10/31 12:46:45  robertj</span>00065 <span class="comment"> * Renamed file for having general thread synchronisation objects.</span>00066 <span class="comment"> * Added conditional mutex and read/write mutex thread synchronisation objects.</span>00067 <span class="comment"> *</span>00068 <span class="comment"> * Revision 1.2  1998/09/23 06:21:35  robertj</span>00069 <span class="comment"> * Added open source copyright license.</span>00070 <span class="comment"> *</span>00071 <span class="comment"> * Revision 1.1  1998/05/30 13:26:15  robertj</span>00072 <span class="comment"> * Initial revision</span>00073 <span class="comment"> *</span>00074 <span class="comment"> */</span>00075 00076 <a name="l00077"></a><a class="code" href="syncthrd_8h.html#a0">00077</a> <span class="preprocessor">#define _PSYNCPOINTACK</span>00078 <span class="preprocessor"></span>00079 <span class="preprocessor">#ifdef P_USE_PRAGMA</span>00080 <span class="preprocessor"></span><span class="preprocessor">#pragma interface</span>00081 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00082 <span class="preprocessor"></span>00083 <span class="preprocessor">#include &lt;<a class="code" href="mutex_8h.html">ptlib/mutex.h</a>&gt;</span>00084 <span class="preprocessor">#include &lt;<a class="code" href="syncpoint_8h.html">ptlib/syncpoint.h</a>&gt;</span>00085 <a name="l00107"></a><a class="code" href="classPSyncPointAck.html">00107</a> <span class="keyword">class </span><a class="code" href="classPSyncPointAck.html">PSyncPointAck</a> : <span class="keyword">public</span> <a class="code" href="classPSyncPoint.html">PSyncPoint</a>00108 {00109   <a class="code" href="object_8h.html#a27">PCLASSINFO</a>(<a class="code" href="classPSyncPointAck.html">PSyncPointAck</a>, <a class="code" href="classPSyncPoint.html">PSyncPoint</a>);00110 00111   <span class="keyword">public</span>:00123     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classPSyncPointAck.html#a0">Signal</a>();00124     <span class="keywordtype">void</span> <a class="code" href="classPSyncPointAck.html#a0">Signal</a>(<span class="keyword">const</span> <a class="code" href="classPTimeInterval.html">PTimeInterval</a> &amp; waitTime);00125 00131     <span class="keywordtype">void</span> <a class="code" href="classPSyncPointAck.html#a2">Acknowledge</a>();00132 00133   <span class="keyword">protected</span>:<a name="l00134"></a><a class="code" href="classPSyncPointAck.html#n0">00134</a>     <a class="code" href="classPSyncPoint.html">PSyncPoint</a> <a class="code" href="classPSyncPointAck.html#n0">ack</a>;00135 };00136 00137 <a name="l00143"></a><a class="code" href="classPCondMutex.html">00143</a> <span class="keyword">class </span><a class="code" href="classPCondMutex.html">PCondMutex</a> : <span class="keyword">public</span> <a class="code" href="classPMutex.html">PMutex</a>00144 {00145   <a class="code" href="object_8h.html#a27">PCLASSINFO</a>(<a class="code" href="classPCondMutex.html">PCondMutex</a>, <a class="code" href="classPMutex.html">PMutex</a>);00146 00147   <span class="keyword">public</span>:00152     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classPCondMutex.html#a0">WaitCondition</a>();00153 00158     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classPCondMutex.html#a1">Signal</a>();00159 00163     <span class="keyword">virtual</span> BOOL <a class="code" href="classPCondMutex.html#a2">Condition</a>() = 0;00164 00169     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classPCondMutex.html#a3">OnWait</a>();00170 00171   <span class="keyword">protected</span>:<a name="l00172"></a><a class="code" href="classPCondMutex.html#n0">00172</a>     <a class="code" href="classPSyncPoint.html">PSyncPoint</a> <a class="code" href="classPCondMutex.html#n0">syncPoint</a>;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -