mirror of
https://github.com/thestk/stk
synced 2026-01-12 20:41:52 +00:00
69 lines
3.5 KiB
HTML
69 lines
3.5 KiB
HTML
<HTML>
|
|
<HEAD>
|
|
<TITLE>The Synthesis ToolKit in C++ (STK)</TITLE>
|
|
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#FFFFFF">
|
|
<CENTER>
|
|
<img src="princeton.gif"> <img src="ccrma.gif"> <img src="mcgill.gif"><P>
|
|
<a class="qindex" href="index.html">Home</a> <a class="qindex" href="information.html">Information</a> <a class="qindex" href="classes.html">Classes</a> <a class="qindex" href="download.html">Download</a> <a class="qindex" href="usage.html">Usage</a> <a class="qindex" href="maillist.html">Mail List</a> <a class="qindex" href="system.html">Requirements</a> <a class="qindex" href="links.html">Links</a> <a class="qindex" href="tutorial.html">Tutorial</a></CENTER>
|
|
<HR>
|
|
<!-- Generated by Doxygen 1.3.4 -->
|
|
<h1>Mutex.h</h1><div class="fragment"><pre>00001 <span class="comment">/***************************************************/</span>
|
|
00012 <span class="comment">/***************************************************/</span>
|
|
00013
|
|
00014 <span class="preprocessor">#ifndef STK_MUTEX_H</span>
|
|
00015 <span class="preprocessor"></span><span class="preprocessor">#define STK_MUTEX_H</span>
|
|
00016 <span class="preprocessor"></span>
|
|
00017 <span class="preprocessor">#include "Stk.h"</span>
|
|
00018
|
|
00019 <span class="preprocessor">#if (defined(__OS_IRIX__) || defined(__OS_LINUX__) || defined(__OS_MACOSX__))</span>
|
|
00020 <span class="preprocessor"></span>
|
|
00021 <span class="preprocessor"> #include <pthread.h></span>
|
|
00022 <span class="keyword">typedef</span> pthread_mutex_t MUTEX;
|
|
00023 <span class="keyword">typedef</span> pthread_cond_t CONDITION;
|
|
00024
|
|
00025 <span class="preprocessor">#elif defined(__OS_WINDOWS__)</span>
|
|
00026 <span class="preprocessor"></span>
|
|
00027 <span class="preprocessor"> #include <windows.h></span>
|
|
00028 <span class="preprocessor"> #include <process.h></span>
|
|
00029 <span class="keyword">typedef</span> CRITICAL_SECTION MUTEX;
|
|
00030 <span class="keyword">typedef</span> HANDLE CONDITION;
|
|
00031
|
|
00032 <span class="preprocessor">#endif</span>
|
|
00033 <span class="preprocessor"></span>
|
|
<a name="l00034"></a><a class="code" href="classMutex.html">00034</a> <span class="keyword">class </span><a class="code" href="classMutex.html">Mutex</a> : <span class="keyword">public</span> <a class="code" href="classStk.html">Stk</a>
|
|
00035 {
|
|
00036 <span class="keyword">public</span>:
|
|
00038 <a class="code" href="classMutex.html#a0">Mutex</a>();
|
|
00039
|
|
00041 <a class="code" href="classMutex.html#a1">~Mutex</a>();
|
|
00042
|
|
00044 <span class="keywordtype">void</span> <a class="code" href="classMutex.html#a2">lock</a>(<span class="keywordtype">void</span>);
|
|
00045
|
|
00047 <span class="keywordtype">void</span> <a class="code" href="classMutex.html#a3">unlock</a>(<span class="keywordtype">void</span>);
|
|
00048
|
|
00050
|
|
00054 <span class="keywordtype">void</span> <a class="code" href="classMutex.html#a4">wait</a>(<span class="keywordtype">void</span>);
|
|
00055
|
|
00057
|
|
00061 <span class="keywordtype">void</span> <a class="code" href="classMutex.html#a5">signal</a>(<span class="keywordtype">void</span>);
|
|
00062
|
|
00063 <span class="keyword">protected</span>:
|
|
00064
|
|
00065 MUTEX mutex_;
|
|
00066 CONDITION condition_;
|
|
00067
|
|
00068 };
|
|
00069
|
|
00070 <span class="preprocessor">#endif</span>
|
|
</pre></div><HR>
|
|
|
|
<table>
|
|
<tr><td><A HREF="http://ccrma.stanford.edu/software/stk/"><I>The Synthesis ToolKit in C++ (STK)</I></A></td></tr>
|
|
<tr><td>©1995-2004 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
|
|
</table>
|
|
|
|
</BODY>
|
|
</HTML>
|