Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > bad97183153701b09df5fae1052b1c30 > files > 3990

crystalspace-doc-1.2.1-5mdv2010.0.i586.rpm

<!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>Crystal Space 1.2.1: csutil/thread.h Source File (Crystal Space 1.2.1 Public API Reference)</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="head">
 <tr height="59">
  <td class="head" width="202" valign="bottom" style="padding-left:0;"><a href="http://www.crystalspace3d.org/"><img src="csblur.png" width="236" height="59" alt="CrystalSpace" border="0"></a></td>
  <td class="head"><h2>Public API Reference</h2></td>
 </tr>
 <tr height="11">
  <td colspan="2" class="headshadow" valign="top" style="padding-left:0;"><img src="csblurb.png" width="236" height="11" alt="" border="0"></td>
 </tr>
</table>
<div class="content">
<!-- Generated by Doxygen 1.5.3 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</span></a></li>
    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
    <li><a href="classes.html"><span>Classes</span></a></li>
    <li class="current"><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul>
</div>
<h1>csutil/thread.h</h1><a href="thread_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment">    Copyright (C) 2002 by Norman Kraemer</span>
<a name="l00003"></a>00003 <span class="comment">  </span>
<a name="l00004"></a>00004 <span class="comment">    This library is free software; you can redistribute it and/or</span>
<a name="l00005"></a>00005 <span class="comment">    modify it under the terms of the GNU Library General Public</span>
<a name="l00006"></a>00006 <span class="comment">    License as published by the Free Software Foundation; either</span>
<a name="l00007"></a>00007 <span class="comment">    version 2 of the License, or (at your option) any later version.</span>
<a name="l00008"></a>00008 <span class="comment">  </span>
<a name="l00009"></a>00009 <span class="comment">    This library is distributed in the hope that it will be useful,</span>
<a name="l00010"></a>00010 <span class="comment">    but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00011"></a>00011 <span class="comment">    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</span>
<a name="l00012"></a>00012 <span class="comment">    Library General Public License for more details.</span>
<a name="l00013"></a>00013 <span class="comment">  </span>
<a name="l00014"></a>00014 <span class="comment">    You should have received a copy of the GNU Library General Public</span>
<a name="l00015"></a>00015 <span class="comment">    License along with this library; if not, write to the Free</span>
<a name="l00016"></a>00016 <span class="comment">    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.</span>
<a name="l00017"></a>00017 <span class="comment">*/</span>
<a name="l00018"></a>00018 
<a name="l00019"></a>00019 <span class="preprocessor">#ifndef __CS_CSSYS_THREAD_H__</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">#define __CS_CSSYS_THREAD_H__</span>
<a name="l00021"></a>00021 <span class="preprocessor"></span>
<a name="l00026"></a>00026 <span class="preprocessor">#include "<a class="code" href="ref_8h.html" title="Smart Pointers.">csutil/ref.h</a>"</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include "<a class="code" href="refcount_8h.html" title="Reference Counting Interface.">csutil/refcount.h</a>"</span>
<a name="l00028"></a>00028 
<a name="l00029"></a>00029 <span class="preprocessor">#include "<a class="code" href="msvc__deprecated__warn__off_8h.html" title="Disable MSVC deprecated warnings.">csutil/win32/msvc_deprecated_warn_off.h</a>"</span>
<a name="l00030"></a>00030 
<a name="l00032"></a>00032 <span class="keyword">enum</span>
<a name="l00033"></a>00033 {
<a name="l00034"></a><a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef60130afc337dfc224041732fb64c5d328">00034</a>   <a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef60130afc337dfc224041732fb64c5d328">CS_THREAD_NO_ERROR</a> = 0,
<a name="l00035"></a><a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef6a22080abefd96fdabab2866affe77688">00035</a>   <a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef6a22080abefd96fdabab2866affe77688">CS_THREAD_UNKNOWN_ERROR</a>,
<a name="l00036"></a><a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef6ff595ef7d934a8d3f5b44ee91a6949ce">00036</a>   <a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef6ff595ef7d934a8d3f5b44ee91a6949ce">CS_THREAD_OUT_OF_RESOURCES</a>,
<a name="l00037"></a><a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef611fdb89f4735212e9cd61f4a024c42ce">00037</a>   <a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef611fdb89f4735212e9cd61f4a024c42ce">CS_THREAD_ERR_ATTRIBUTE</a>,
<a name="l00038"></a><a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef63e8baf30bc913a9383ab23daab110d01">00038</a>   <a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef63e8baf30bc913a9383ab23daab110d01">CS_THREAD_NO_PERMISSION</a>,
<a name="l00039"></a><a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef6f62ff65a4063fb3aa1c3b50005808f25">00039</a>   <a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef6f62ff65a4063fb3aa1c3b50005808f25">CS_THREAD_UNKNOWN_THREAD</a>,
<a name="l00040"></a><a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef6b0d839ea1a6b7929d63ffc656c457c77">00040</a>   <a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef6b0d839ea1a6b7929d63ffc656c457c77">CS_THREAD_DEADLOCK</a>,
<a name="l00041"></a><a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef6e4393f7e5bab1f1dff88c33982d3905a">00041</a>   <a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef6e4393f7e5bab1f1dff88c33982d3905a">CS_THREAD_OPERATION_PENDING</a>,
<a name="l00042"></a><a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef613b493aaa6a02012a82bab5665f7b1d5">00042</a>   <a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef613b493aaa6a02012a82bab5665f7b1d5">CS_THREAD_MUTEX_NOT_INITIALIZED</a>,
<a name="l00043"></a><a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef615dc1b9a3578055fa7feeb579226c94b">00043</a>   <a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef615dc1b9a3578055fa7feeb579226c94b">CS_THREAD_MUTEX_BUSY</a>,
<a name="l00044"></a><a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef6df15fe252e1725f263b9a0d87a05ddca">00044</a>   <a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef6df15fe252e1725f263b9a0d87a05ddca">CS_THREAD_MUTEX_UNKNOWN</a>,
<a name="l00045"></a><a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef69220681e5d5aba5fad03010cc5f24b7f">00045</a>   <a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef69220681e5d5aba5fad03010cc5f24b7f">CS_THREAD_CONDITION_TIMEOUT</a>,
<a name="l00046"></a><a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef6028d6904034803d88387af31a4c1cbfb">00046</a>   <a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef6028d6904034803d88387af31a4c1cbfb">CS_THREAD_CONDITION_BUSY</a>,
<a name="l00047"></a><a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef6c85274d0fc64f41eda14b8520ca4e1fb">00047</a>   <a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef6c85274d0fc64f41eda14b8520ca4e1fb">CS_THREAD_CONDITION_WAIT_INTERRUPTED</a>,
<a name="l00048"></a><a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef69fd61ed3001e8b877c13eaea9cc730a0">00048</a>   <a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef69fd61ed3001e8b877c13eaea9cc730a0">CS_THREAD_SIGNAL_UNKNOWN</a>,
<a name="l00049"></a><a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef6946fc13f2c93b6c272bfdb87d16bee0d">00049</a>   <a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef6946fc13f2c93b6c272bfdb87d16bee0d">CS_THREAD_SEMA_VALUE_TOO_LARGE</a>,
<a name="l00050"></a><a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef605ba5bb0e5d46450f7ec028888d7bfc5">00050</a>   <a class="code" href="thread_8h.html#e6dceca96ec2c7a1b4aa211264a87ef605ba5bb0e5d46450f7ec028888d7bfc5">CS_THREAD_SEMA_BUSY</a>
<a name="l00051"></a>00051 };
<a name="l00052"></a>00052 
<a name="l00053"></a>00053 <span class="comment">/* Priority values indicate how frequently a thread runs compared to other threads.</span>
<a name="l00054"></a>00054 <span class="comment"> *</span>
<a name="l00055"></a>00055 <span class="comment"> * Thread scheduling is handled by the underlying OS, and so the true meaning of these</span>
<a name="l00056"></a>00056 <span class="comment"> *  values will vary depending on platform.  A minimal set of values is defined for CS</span>
<a name="l00057"></a>00057 <span class="comment"> *  so that chances of support of the full range of values by the platform are greater.</span>
<a name="l00058"></a>00058 <span class="comment">*/</span>
<a name="l00059"></a><a class="code" href="thread_8h.html#3d607d7f8fb2cff5e7a70ac8ba03afb3">00059</a> <span class="keyword">typedef</span> <span class="keyword">enum</span>
<a name="l00060"></a>00060 {
<a name="l00061"></a>00061   <span class="comment">// IDLE priority is the lowest priority.  Threads with this priority are scheduled to</span>
<a name="l00062"></a>00062   <span class="comment">//  run only when no other thread would be running anyway - or as close as the platform</span>
<a name="l00063"></a>00063   <span class="comment">//  allows.</span>
<a name="l00064"></a><a class="code" href="thread_8h.html#3d607d7f8fb2cff5e7a70ac8ba03afb3ff7c459a3f7f382eecf3750305bbc6a2">00064</a>   <a class="code" href="thread_8h.html#3d607d7f8fb2cff5e7a70ac8ba03afb3ff7c459a3f7f382eecf3750305bbc6a2">CS_THREAD_PRIORITY_IDLE</a>=0,
<a name="l00065"></a>00065   <span class="comment">// NORMAL priority is the default priority.</span>
<a name="l00066"></a><a class="code" href="thread_8h.html#3d607d7f8fb2cff5e7a70ac8ba03afb3cb87800fb332515f20f61046576b377d">00066</a>   <a class="code" href="thread_8h.html#3d607d7f8fb2cff5e7a70ac8ba03afb3cb87800fb332515f20f61046576b377d">CS_THREAD_PRIORITY_NORMAL</a>,
<a name="l00067"></a>00067   <span class="comment">// TIMECRITICAL is the highest priority.</span>
<a name="l00068"></a><a class="code" href="thread_8h.html#3d607d7f8fb2cff5e7a70ac8ba03afb3ce3dbfa7d7379e50f8710a9884924a2d">00068</a>   <a class="code" href="thread_8h.html#3d607d7f8fb2cff5e7a70ac8ba03afb3ce3dbfa7d7379e50f8710a9884924a2d">CS_THREAD_PRIORITY_TIMECRITICAL</a>
<a name="l00069"></a>00069 } <a class="code" href="thread_8h.html#3d607d7f8fb2cff5e7a70ac8ba03afb3">csThreadPriority</a>;
<a name="l00070"></a>00070 
<a name="l00071"></a>00071 
<a name="l00077"></a><a class="code" href="classcsRunnable.html">00077</a> <span class="keyword">class </span><a class="code" href="cssysdef_8h.html#91e256b131a2cf6b4b9db8830a0c88f4" title="A variant of CS_DEPRECATED_TYPE that also emits the message msg on compilers that...">CS_DEPRECATED_TYPE_MSG</a>("<a class="code" href="classcsRunnable.html" title="Abstract interface for objects which can be run in a thread.">csRunnable</a> is deprecated. Use new subsystem in CS::Threading instead") 
<a name="l00078"></a>00078   <a class="code" href="classcsRunnable.html" title="Abstract interface for objects which can be run in a thread.">csRunnable</a>
<a name="l00079"></a>00079 {
<a name="l00080"></a>00080 <span class="keyword">protected</span>:
<a name="l00085"></a><a class="code" href="classcsRunnable.html#7ce023ce123572b5faed3560c7ee1a3e">00085</a>   <span class="keyword">virtual</span> <a class="code" href="classcsRunnable.html#7ce023ce123572b5faed3560c7ee1a3e" title="Needed for GCC4.">~csRunnable</a>() {}
<a name="l00086"></a>00086 <span class="keyword">public</span>:
<a name="l00088"></a>00088   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classcsRunnable.html#92eef3efda1388219e00146629f3a597" title="Implement this method to allow your object to be run in a thread.">Run</a> () = 0;
<a name="l00089"></a>00089 
<a name="l00090"></a>00090   <span class="comment">/* maybe we could add those for smoother exit/cancel/detroy operations</span>
<a name="l00091"></a>00091 <span class="comment">  virtual void PrepareExit () = 0;</span>
<a name="l00092"></a>00092 <span class="comment">  virtual void PrepareJoin () = 0;</span>
<a name="l00093"></a>00093 <span class="comment">  virtual void PrepareKill () = 0;</span>
<a name="l00094"></a>00094 <span class="comment">  virtual void PrepareCancel () = 0;</span>
<a name="l00095"></a>00095 <span class="comment">  virtual void PrepareDestroy () = 0;</span>
<a name="l00096"></a>00096 <span class="comment">  */</span>
<a name="l00097"></a>00097 
<a name="l00099"></a>00099   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classcsRunnable.html#16254cb87076b1c92d4ab74e955f7f90" title="Increment reference count.">IncRef</a>() = 0;
<a name="l00101"></a>00101   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classcsRunnable.html#55efa1db1a7d178dcb4bb0da96bfd56a" title="Decrement reference count.">DecRef</a>() = 0;
<a name="l00103"></a>00103   <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classcsRunnable.html#dbc3e72f46424389e86447066dc51972" title="Get reference count.">GetRefCount</a>() = 0;
<a name="l00104"></a>00104 };
<a name="l00105"></a>00105 
<a name="l00106"></a>00106 
<a name="l00111"></a><a class="code" href="classcsThread.html">00111</a> <span class="keyword">class </span>CS_CRYSTALSPACE_EXPORT 
<a name="l00112"></a>00112   <a class="code" href="cssysdef_8h.html#91e256b131a2cf6b4b9db8830a0c88f4" title="A variant of CS_DEPRECATED_TYPE that also emits the message msg on compilers that...">CS_DEPRECATED_TYPE_MSG</a>("<a class="code" href="classcsThread.html" title="Representation of a thread of executation.">csThread</a> is deprecated. Use CS::Threading::Thread instead")
<a name="l00113"></a>00113   <a class="code" href="classcsThread.html" title="Representation of a thread of executation.">csThread</a> : <span class="keyword">public</span> <a class="code" href="classcsRefCount.html" title="This is a class which provides basic reference-counting semantics.">csRefCount</a>
<a name="l00114"></a>00114 {
<a name="l00115"></a>00115 <span class="keyword">public</span>:
<a name="l00120"></a>00120   <span class="keyword">static</span> <a class="code" href="classcsRef.html" title="A smart pointer.">csRef&lt;csThread&gt;</a> <a class="code" href="classcsThread.html#42bc8c166026a1bf1d847e65e731d605" title="Create a new thread.">Create</a> (<a class="code" href="classcsRunnable.html" title="Abstract interface for objects which can be run in a thread.">csRunnable</a>*, <a class="code" href="group__util.html#g1134b580f8da4de94ca6b1de4d37975e" title="unsigned 32-bit integer (0..4 294 967 295)">uint32</a> options = 0);
<a name="l00121"></a>00121 
<a name="l00126"></a>00126   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classcsThread.html#ebaf0314c2f2378445f20b8b6d379407" title="Start the thread.">Start</a> () = 0;
<a name="l00127"></a>00127 
<a name="l00136"></a>00136   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classcsThread.html#50d3548b31540db502d2e632299a7ffc" title="Unmercifully stop the thread as soon as possible.">Stop</a> () = 0;
<a name="l00137"></a>00137 
<a name="l00141"></a>00141   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classcsThread.html#ea36523b870be22c373d3a7567f8421b" title="Wait for the thread to die.">Wait</a> () = 0;
<a name="l00142"></a>00142 
<a name="l00149"></a>00149   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classcsThread.html#0e4848420b6d46dff72553d8de76ba24" title="Yield Thread frees CPU time if nothing to do.">Yield</a> () = 0;
<a name="l00150"></a>00150 
<a name="l00155"></a>00155   <span class="keyword">virtual</span> <a class="code" href="thread_8h.html#3d607d7f8fb2cff5e7a70ac8ba03afb3">csThreadPriority</a> <a class="code" href="classcsThread.html#ce8a2c1f9445641538c4f50ebc2c5944" title="Retrieve the current execution priority of this thread.">GetPriority</a>() = 0;
<a name="l00156"></a>00156 
<a name="l00162"></a>00162   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classcsThread.html#79338324aa559bd800818ee693c0e2e8" title="Set the current execution priority of this thread.">SetPriority</a>(<a class="code" href="thread_8h.html#3d607d7f8fb2cff5e7a70ac8ba03afb3">csThreadPriority</a> Priority) = 0;
<a name="l00163"></a>00163 
<a name="l00167"></a>00167   <span class="keyword">virtual</span> <span class="keywordtype">char</span> <span class="keyword">const</span>* <a class="code" href="classcsThread.html#af89f594c671284f54fd2ae5cbf1bd57" title="Return the last error description, else 0 if there was none.">GetLastError</a> () <span class="keyword">const</span> = 0;
<a name="l00168"></a>00168 };
<a name="l00169"></a>00169 
<a name="l00170"></a>00170 
<a name="l00179"></a><a class="code" href="classcsMutex.html">00179</a> <span class="keyword">class </span>CS_CRYSTALSPACE_EXPORT 
<a name="l00180"></a>00180   <a class="code" href="cssysdef_8h.html#91e256b131a2cf6b4b9db8830a0c88f4" title="A variant of CS_DEPRECATED_TYPE that also emits the message msg on compilers that...">CS_DEPRECATED_TYPE_MSG</a>("<a class="code" href="classcsMutex.html" title="A mutual-exclusion object.">csMutex</a> is deprecated. Use new subsystem in CS::Threading instead") 
<a name="l00181"></a>00181   <a class="code" href="classcsMutex.html" title="A mutual-exclusion object.">csMutex</a> : <span class="keyword">public</span> <a class="code" href="classcsRefCount.html" title="This is a class which provides basic reference-counting semantics.">csRefCount</a>
<a name="l00182"></a>00182 {
<a name="l00183"></a>00183 <span class="keyword">public</span>:
<a name="l00197"></a>00197   <span class="keyword">static</span> <a class="code" href="classcsRef.html" title="A smart pointer.">csRef&lt;csMutex&gt;</a> <a class="code" href="classcsMutex.html#04a7f6e1dcc9ba82ab51cf66eefc787b" title="Create a mutex.">Create</a> (<span class="keywordtype">bool</span> recursive = <span class="keyword">false</span>);
<a name="l00198"></a>00198 
<a name="l00205"></a>00205   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classcsMutex.html#9e037cca32b323f1a590d53db570b134" title="Lock the mutex.">LockWait</a>() = 0;
<a name="l00206"></a>00206 
<a name="l00213"></a>00213   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classcsMutex.html#ca97fc194aff82b7fbab424a03f2711c" title="Lock the mutex if not already locked by some other entity.">LockTry</a> () = 0;
<a name="l00214"></a>00214 
<a name="l00221"></a>00221   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classcsMutex.html#ad4921586c4d05e0f008251993a85d74" title="Unlock the mutex.">Release</a> () = 0;
<a name="l00222"></a>00222 
<a name="l00226"></a>00226   <span class="keyword">virtual</span> <span class="keywordtype">char</span> <span class="keyword">const</span>* <a class="code" href="classcsMutex.html#720d9d9ecb07f64aaf5e8168ddd11b42" title="Return the last error description, else 0 if there was none.">GetLastError</a> () <span class="keyword">const</span> = 0;
<a name="l00227"></a>00227 
<a name="l00231"></a>00231   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classcsMutex.html#02e3f6227490351ea8df0362bf4f24a9" title="Return true if the mutex is recursive.">IsRecursive</a> () <span class="keyword">const</span> = 0;
<a name="l00232"></a>00232 };
<a name="l00233"></a>00233 
<a name="l00234"></a>00234 
<a name="l00239"></a><a class="code" href="classcsSemaphore.html">00239</a> <span class="keyword">class </span>CS_CRYSTALSPACE_EXPORT 
<a name="l00240"></a>00240   <a class="code" href="cssysdef_8h.html#91e256b131a2cf6b4b9db8830a0c88f4" title="A variant of CS_DEPRECATED_TYPE that also emits the message msg on compilers that...">CS_DEPRECATED_TYPE_MSG</a>("<a class="code" href="classcsSemaphore.html" title="A semaphore object.">csSemaphore</a> is deprecated. Use new subsystem in CS::Threading instead") 
<a name="l00241"></a>00241   <a class="code" href="classcsSemaphore.html" title="A semaphore object.">csSemaphore</a> : <span class="keyword">public</span> <a class="code" href="classcsRefCount.html" title="This is a class which provides basic reference-counting semantics.">csRefCount</a>
<a name="l00242"></a>00242 {
<a name="l00243"></a>00243 <span class="keyword">public</span>:
<a name="l00245"></a>00245   <span class="keyword">static</span> <a class="code" href="classcsRef.html" title="A smart pointer.">csRef&lt;csSemaphore&gt;</a> <a class="code" href="classcsSemaphore.html#214293fbb6eb5f85d03c38b0784af7f1" title="Create a semaphore with some initial value.">Create</a> (<a class="code" href="group__util.html#g1134b580f8da4de94ca6b1de4d37975e" title="unsigned 32-bit integer (0..4 294 967 295)">uint32</a> value = 0);
<a name="l00246"></a>00246 
<a name="l00253"></a>00253   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classcsSemaphore.html#49c647c7a11cdf827f255edbe7c430e5" title="Lock the semaphore.">LockWait</a> () = 0;
<a name="l00254"></a>00254 
<a name="l00261"></a>00261   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classcsSemaphore.html#70310eb7aa191c1cad77e240a8a4e27d" title="Lock the semaphore if not already locked by some other entity.">LockTry</a> () = 0;
<a name="l00262"></a>00262 
<a name="l00269"></a>00269   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classcsSemaphore.html#eb7266570aa0e6ba4062121f978d6003" title="Unlock the semaphore.">Release</a> () = 0;
<a name="l00270"></a>00270 
<a name="l00272"></a>00272   <span class="keyword">virtual</span> <a class="code" href="group__util.html#g1134b580f8da4de94ca6b1de4d37975e" title="unsigned 32-bit integer (0..4 294 967 295)">uint32</a> <a class="code" href="classcsSemaphore.html#0ef24962ab0ac55861e9e24333fc05c5" title="Retrieve the present value of the semaphore.">Value</a> () = 0;
<a name="l00273"></a>00273 
<a name="l00277"></a>00277   <span class="keyword">virtual</span> <span class="keywordtype">char</span> <span class="keyword">const</span>* <a class="code" href="classcsSemaphore.html#e98d6584eec2efcb8c87a39bf6385d2a" title="Return the last error description, else 0 if there was none.">GetLastError</a> () <span class="keyword">const</span> = 0;
<a name="l00278"></a>00278 };
<a name="l00279"></a>00279 
<a name="l00280"></a>00280 
<a name="l00285"></a><a class="code" href="classcsCondition.html">00285</a> <span class="keyword">class </span>CS_CRYSTALSPACE_EXPORT
<a name="l00286"></a>00286   <a class="code" href="cssysdef_8h.html#91e256b131a2cf6b4b9db8830a0c88f4" title="A variant of CS_DEPRECATED_TYPE that also emits the message msg on compilers that...">CS_DEPRECATED_TYPE_MSG</a>("<a class="code" href="classcsCondition.html" title="A condition object.">csCondition</a> is deprecated. Use new subsystem in CS::Threading instead") 
<a name="l00287"></a>00287   <a class="code" href="classcsCondition.html" title="A condition object.">csCondition</a> : <span class="keyword">public</span> <a class="code" href="classcsRefCount.html" title="This is a class which provides basic reference-counting semantics.">csRefCount</a>
<a name="l00288"></a>00288 {
<a name="l00289"></a>00289 <span class="keyword">public</span>:
<a name="l00291"></a>00291   <span class="keyword">static</span> <a class="code" href="classcsRef.html" title="A smart pointer.">csRef&lt;csCondition&gt;</a> <a class="code" href="classcsCondition.html#79fdf1922e66028d28d75d532f61da16" title="Create a condition with specific attributes.">Create</a> (<a class="code" href="group__util.html#g1134b580f8da4de94ca6b1de4d37975e" title="unsigned 32-bit integer (0..4 294 967 295)">uint32</a> conditionAttributes = 0);
<a name="l00292"></a>00292 
<a name="l00301"></a>00301   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classcsCondition.html#36d2e191c6e5111d055c5d7bfa2285b1" title="Wake up one or all threads waiting upon a change of condition.">Signal</a> (<span class="keywordtype">bool</span> WakeAll = <span class="keyword">false</span>) = 0;
<a name="l00302"></a>00302 
<a name="l00328"></a>00328   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classcsCondition.html#2813394aecf8b91dbfa65499249fb88a" title="Wait for some change of condition.">Wait</a> (<a class="code" href="classcsMutex.html" title="A mutual-exclusion object.">csMutex</a>* mutex, <a class="code" href="group__util.html#g28e82998c4c2d1197a1d412bba7da793" title="A time value measured in milliseconds (1/1000 of a second).">csTicks</a> timeout = 0) = 0;
<a name="l00329"></a>00329 
<a name="l00333"></a>00333   <span class="keyword">virtual</span> <span class="keywordtype">char</span> <span class="keyword">const</span>* <a class="code" href="classcsCondition.html#b82465b551ae7fac8c63474b3826f8bc" title="Return the last error description, else null if there was none.">GetLastError</a> () <span class="keyword">const</span> = 0;
<a name="l00334"></a>00334 };
<a name="l00335"></a>00335 
<a name="l00336"></a>00336 <span class="preprocessor">#include "<a class="code" href="msvc__deprecated__warn__on_8h.html" title="Re-enable MSVC deprecated warnings.">csutil/win32/msvc_deprecated_warn_on.h</a>"</span>
<a name="l00337"></a>00337 
<a name="l00338"></a>00338 <span class="preprocessor">#endif // __CS_CSSYS_THREAD_H__</span>
</pre></div><hr size="1"><address><small>Generated for Crystal Space 1.2.1 by 
<a href="http://www.doxygen.org/index.html">doxygen</a> 1.5.3 
</small></address> </div></body> </html>