Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > 6e7a2755bd78c9deedab199b86e675f3 > files > 6655

gnuradio-doc-3.2.2-9.fc14.x86_64.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>GNU Radio 3.2.2 C++ API: ot_VxThread.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.3 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">GNU Radio 3.2.2 C++ API</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('ot__VxThread_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<h1>ot_VxThread.h</h1>  </div>
</div>
<div class="contents">
<a href="ot__VxThread_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef __VXTHREAD_H__</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define __VXTHREAD_H__</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span><span class="comment">/*</span>
<a name="l00004"></a>00004 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
<a name="l00005"></a>00005 <span class="comment">%% Project:     omniORB</span>
<a name="l00006"></a>00006 <span class="comment">%% Filename:    $Filename$</span>
<a name="l00007"></a>00007 <span class="comment">%% Author:      Guillaume/Bill ARRECKX</span>
<a name="l00008"></a>00008 <span class="comment">%%              Copyright Wavetek Wandel &amp; Goltermann, Plymouth.</span>
<a name="l00009"></a>00009 <span class="comment">%% Description: OMNI thread implementation classes for VxWorks threads</span>
<a name="l00010"></a>00010 <span class="comment">%% Notes:</span>
<a name="l00011"></a>00011 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
<a name="l00012"></a>00012 <span class="comment">%% $Log$</span>
<a name="l00013"></a>00013 <span class="comment">%% Revision 1.1  2004/04/10 18:00:52  eb</span>
<a name="l00014"></a>00014 <span class="comment">%% Initial revision</span>
<a name="l00015"></a>00015 <span class="comment">%%</span>
<a name="l00016"></a>00016 <span class="comment">%% Revision 1.1.1.1  2004/03/01 00:20:27  eb</span>
<a name="l00017"></a>00017 <span class="comment">%% initial checkin</span>
<a name="l00018"></a>00018 <span class="comment">%%</span>
<a name="l00019"></a>00019 <span class="comment">%% Revision 1.1  2003/05/25 05:29:04  eb</span>
<a name="l00020"></a>00020 <span class="comment">%% see ChangeLog</span>
<a name="l00021"></a>00021 <span class="comment">%%</span>
<a name="l00022"></a>00022 <span class="comment">%% Revision 1.1.2.1  2003/02/17 02:03:07  dgrisby</span>
<a name="l00023"></a>00023 <span class="comment">%% vxWorks port. (Thanks Michael Sturm / Acterna Eningen GmbH).</span>
<a name="l00024"></a>00024 <span class="comment">%%</span>
<a name="l00025"></a>00025 <span class="comment">%% Revision 1.1.1.1  2002/11/19 14:55:21  sokcevti</span>
<a name="l00026"></a>00026 <span class="comment">%% OmniOrb4.0.0 VxWorks port</span>
<a name="l00027"></a>00027 <span class="comment">%%</span>
<a name="l00028"></a>00028 <span class="comment">%% Revision 1.2  2002/06/14 12:45:50  engeln</span>
<a name="l00029"></a>00029 <span class="comment">%% unnecessary members in condition removed.</span>
<a name="l00030"></a>00030 <span class="comment">%% ---</span>
<a name="l00031"></a>00031 <span class="comment">%%</span>
<a name="l00032"></a>00032 <span class="comment">%% Revision 1.1.1.1  2002/04/02 10:08:49  sokcevti</span>
<a name="l00033"></a>00033 <span class="comment">%% omniORB4 initial realease</span>
<a name="l00034"></a>00034 <span class="comment">%%</span>
<a name="l00035"></a>00035 <span class="comment">%% Revision 1.1  2001/03/23 16:50:23  hartmut</span>
<a name="l00036"></a>00036 <span class="comment">%% Initial Version 2.8</span>
<a name="l00037"></a>00037 <span class="comment">%%</span>
<a name="l00038"></a>00038 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
<a name="l00039"></a>00039 <span class="comment">*/</span>
<a name="l00040"></a>00040 
<a name="l00041"></a>00041 <span class="comment"></span>
<a name="l00042"></a>00042 <span class="comment">///////////////////////////////////////////////////////////////////////////</span>
<a name="l00043"></a>00043 <span class="comment"></span><span class="comment">// Includes</span><span class="comment"></span>
<a name="l00044"></a>00044 <span class="comment">///////////////////////////////////////////////////////////////////////////</span>
<a name="l00045"></a>00045 <span class="comment"></span><span class="preprocessor">#include &lt;vxWorks.h&gt;</span>
<a name="l00046"></a>00046 <span class="preprocessor">#include &lt;semLib.h&gt;</span>
<a name="l00047"></a>00047 <span class="preprocessor">#include &lt;taskLib.h&gt;</span>
<a name="l00048"></a>00048 
<a name="l00049"></a>00049 <span class="comment"></span>
<a name="l00050"></a>00050 <span class="comment">///////////////////////////////////////////////////////////////////////////</span>
<a name="l00051"></a>00051 <span class="comment"></span><span class="comment">// Externs prototypes</span><span class="comment"></span>
<a name="l00052"></a>00052 <span class="comment">///////////////////////////////////////////////////////////////////////////</span>
<a name="l00053"></a>00053 <span class="comment"></span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> <span class="keywordtype">void</span> <a class="code" href="ot__mach_8h.html#a0fe327b90ff0e8892b51da53b7cb77df">omni_thread_wrapper</a>(<span class="keywordtype">void</span>* ptr);
<a name="l00054"></a>00054 
<a name="l00055"></a>00055 <span class="comment"></span>
<a name="l00056"></a>00056 <span class="comment">///////////////////////////////////////////////////////////////////////////</span>
<a name="l00057"></a>00057 <span class="comment"></span><span class="comment">// Exported macros</span>
<a name="l00058"></a>00058 <span class="comment">// Note: These are added as private members in each class implementation.</span><span class="comment"></span>
<a name="l00059"></a>00059 <span class="comment">///////////////////////////////////////////////////////////////////////////</span>
<a name="l00060"></a><a class="code" href="ot__VxThread_8h.html#a7ad99028e48ab278b80a11e32ec300e2">00060</a> <span class="comment"></span><span class="preprocessor">#define OMNI_MUTEX_IMPLEMENTATION \</span>
<a name="l00061"></a>00061 <span class="preprocessor">   SEM_ID mutexID;      \</span>
<a name="l00062"></a>00062 <span class="preprocessor">   bool m_bConstructed;</span>
<a name="l00063"></a>00063 <span class="preprocessor"></span>
<a name="l00064"></a><a class="code" href="ot__VxThread_8h.html#a92b19edc455706d139150fe3d44d2943">00064</a> <span class="preprocessor">#define OMNI_CONDITION_IMPLEMENTATION \</span>
<a name="l00065"></a>00065 <span class="preprocessor">   long waiters_; \</span>
<a name="l00066"></a>00066 <span class="preprocessor">   SEM_ID waiters_lock_; \</span>
<a name="l00067"></a>00067 <span class="preprocessor">   SEM_ID sema_;</span>
<a name="l00068"></a>00068 <span class="preprocessor"></span>
<a name="l00069"></a><a class="code" href="ot__VxThread_8h.html#a1b0bdd06018f31de329a10966ff315d6">00069</a> <span class="preprocessor">#define OMNI_SEMAPHORE_IMPLEMENTATION \</span>
<a name="l00070"></a>00070 <span class="preprocessor">   SEM_ID semID;</span>
<a name="l00071"></a>00071 <span class="preprocessor"></span>
<a name="l00072"></a><a class="code" href="ot__VxThread_8h.html#a869be82c956dc858288b691ec920e94e">00072</a> <span class="preprocessor">#define OMNI_MUTEX_LOCK_IMPLEMENTATION                  \</span>
<a name="l00073"></a>00073 <span class="preprocessor">        if(semTake(mutexID, WAIT_FOREVER) != OK)        \</span>
<a name="l00074"></a>00074 <span class="preprocessor">        {       \</span>
<a name="l00075"></a>00075 <span class="preprocessor">                throw omni_thread_fatal(errno); \</span>
<a name="l00076"></a>00076 <span class="preprocessor">        }</span>
<a name="l00077"></a>00077 <span class="preprocessor"></span>
<a name="l00078"></a><a class="code" href="ot__VxThread_8h.html#ae5eea767ddd262fa3a5fe58bf134c88b">00078</a> <span class="preprocessor">#define OMNI_MUTEX_UNLOCK_IMPLEMENTATION                \</span>
<a name="l00079"></a>00079 <span class="preprocessor">        if(semGive(mutexID) != OK)      \</span>
<a name="l00080"></a>00080 <span class="preprocessor">        {       \</span>
<a name="l00081"></a>00081 <span class="preprocessor">                throw omni_thread_fatal(errno); \</span>
<a name="l00082"></a>00082 <span class="preprocessor">        }</span>
<a name="l00083"></a>00083 <span class="preprocessor"></span>
<a name="l00084"></a><a class="code" href="ot__VxThread_8h.html#acc85df821c0e286ac63c0198c691ddff">00084</a> <span class="preprocessor">#define OMNI_THREAD_IMPLEMENTATION \</span>
<a name="l00085"></a>00085 <span class="preprocessor">   friend void omni_thread_wrapper(void* ptr); \</span>
<a name="l00086"></a>00086 <span class="preprocessor">   static int vxworks_priority(priority_t); \</span>
<a name="l00087"></a>00087 <span class="preprocessor">   omni_condition *running_cond; \</span>
<a name="l00088"></a>00088 <span class="preprocessor">   void* return_val; \</span>
<a name="l00089"></a>00089 <span class="preprocessor">   int tid; \</span>
<a name="l00090"></a>00090 <span class="preprocessor">   public: \</span>
<a name="l00091"></a>00091 <span class="preprocessor">   static void attach(void); \</span>
<a name="l00092"></a>00092 <span class="preprocessor">   static void detach(void); \</span>
<a name="l00093"></a>00093 <span class="preprocessor">   static void show(void);</span>
<a name="l00094"></a>00094 <span class="preprocessor"></span>
<a name="l00095"></a>00095 <span class="comment"></span>
<a name="l00096"></a>00096 <span class="comment">///////////////////////////////////////////////////////////////////////////</span>
<a name="l00097"></a>00097 <span class="comment"></span><span class="comment">// Porting macros</span><span class="comment"></span>
<a name="l00098"></a>00098 <span class="comment">///////////////////////////////////////////////////////////////////////////</span>
<a name="l00099"></a>00099 <span class="comment"></span><span class="comment">// This is a wrapper function for the &#39;main&#39; function which does not exists</span>
<a name="l00100"></a>00100 <span class="comment">//  as such in VxWorks. The wrapper creates a launch function instead,</span>
<a name="l00101"></a>00101 <span class="comment">//  which spawns the application wrapped in a omni_thread.</span>
<a name="l00102"></a>00102 <span class="comment">// Argc will always be null.</span><span class="comment"></span>
<a name="l00103"></a>00103 <span class="comment">///////////////////////////////////////////////////////////////////////////</span>
<a name="l00104"></a><a class="code" href="ot__VxThread_8h.html#abf2a4be0664ec91c1d8f8dcdc69fab46">00104</a> <span class="comment"></span><span class="preprocessor">#define main( discarded_argc, discarded_argv ) \</span>
<a name="l00105"></a>00105 <span class="preprocessor">        omni_discard_retval() \</span>
<a name="l00106"></a>00106 <span class="preprocessor">          { \</span>
<a name="l00107"></a>00107 <span class="preprocessor">          throw; \</span>
<a name="l00108"></a>00108 <span class="preprocessor">          } \</span>
<a name="l00109"></a>00109 <span class="preprocessor">        int omni_main( int argc, char **argv ); \</span>
<a name="l00110"></a>00110 <span class="preprocessor">        void launch( ) \</span>
<a name="l00111"></a>00111 <span class="preprocessor">          { \</span>
<a name="l00112"></a>00112 <span class="preprocessor">          omni_thread* th = new omni_thread( (void(*)(void*))omni_main );\</span>
<a name="l00113"></a>00113 <span class="preprocessor">          th-&gt;start();\</span>
<a name="l00114"></a>00114 <span class="preprocessor">          }\</span>
<a name="l00115"></a>00115 <span class="preprocessor">        int omni_main( int argc, char **argv )</span>
<a name="l00116"></a>00116 <span class="preprocessor"></span>
<a name="l00117"></a>00117 
<a name="l00118"></a>00118 <span class="preprocessor">#endif // ndef __VXTHREAD_H__</span>
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="ot__VxThread_8h.html">ot_VxThread.h</a>      </li>
      <li class="footer">Generated on Thu Feb 17 2011 for GNU Radio 3.2.2 C++ API by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </li>
    </ul>
  </div>

</body>
</html>