| <!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>oscl_thread.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> <a class="qindex" href="modules.html">Modules</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Data Structures</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Data Fields</a> <a class="qindex" href="globals.html">Globals</a> </center> |
| <hr><h1>oscl_thread.h</h1><a href="oscl__thread_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">// -*- c++ -*-</span> |
| 00002 <span class="comment">// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</span> |
| 00003 |
| 00004 <span class="comment">// OSCL_T H R E A D (T H R E A D I M P L E M E N T A T I O N)</span> |
| 00005 |
| 00006 <span class="comment">// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</span> |
| 00007 |
| 00013 <span class="comment">// Definition file for OSCL Threads</span> |
| 00014 <span class="preprocessor">#ifndef OSCL_THREAD_H_INCLUDED</span> |
| 00015 <span class="preprocessor"></span><span class="preprocessor">#define OSCL_THREAD_H_INCLUDED</span> |
| 00016 <span class="preprocessor"></span> |
| 00017 <span class="preprocessor">#ifndef OSCLCONFIG_PROC_H_INCLUDED</span> |
| 00018 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="osclconfig__proc_8h.html">osclconfig_proc.h</a>"</span> |
| 00019 <span class="preprocessor">#endif</span> |
| 00020 <span class="preprocessor"></span> |
| 00021 <span class="preprocessor">#ifndef OSCL_PROCSTATUS_H_INCLUDED</span> |
| 00022 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__procstatus_8h.html">oscl_procstatus.h</a>"</span> |
| 00023 <span class="preprocessor">#endif</span> |
| 00024 <span class="preprocessor"></span> |
| 00025 <span class="preprocessor">#ifndef OSCL_BASE_H_INCLUDED</span> |
| 00026 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__base_8h.html">oscl_base.h</a>"</span> |
| 00027 <span class="preprocessor">#endif</span> |
| 00028 <span class="preprocessor"></span> |
| 00029 |
| 00030 <span class="comment">// Thread state on creation</span> |
| <a name="l00031"></a><a class="code" href="oscl__thread_8h.html#a10">00031</a> <span class="keyword">enum</span> <a class="code" href="oscl__thread_8h.html#a10">OsclThread_State</a> |
| 00032 { |
| 00033 <a class="code" href="oscl__thread_8h.html#a10a1">Start_on_creation</a> |
| 00034 , <a class="code" href="oscl__thread_8h.html#a10a2">Suspend_on_creation</a> |
| 00035 }; |
| 00036 |
| 00037 <span class="comment">// Enumerated Priority Values</span> |
| <a name="l00038"></a><a class="code" href="oscl__thread_8h.html#a11">00038</a> <span class="keyword">enum</span> <a class="code" href="oscl__thread_8h.html#a11">OsclThreadPriority</a> |
| 00039 { |
| 00040 <a class="code" href="oscl__thread_8h.html#a11a3">ThreadPriorityLowest</a> |
| 00041 , <a class="code" href="oscl__thread_8h.html#a11a4">ThreadPriorityLow</a> |
| 00042 , <a class="code" href="oscl__thread_8h.html#a11a5">ThreadPriorityBelowNormal</a> |
| 00043 , <a class="code" href="oscl__thread_8h.html#a11a6">ThreadPriorityNormal</a> |
| 00044 , <a class="code" href="oscl__thread_8h.html#a11a7">ThreadPriorityAboveNormal</a> |
| 00045 , <a class="code" href="oscl__thread_8h.html#a11a8">ThreadPriorityHighest</a> |
| 00046 , <a class="code" href="oscl__thread_8h.html#a11a9">ThreadPriorityTimeCritical</a> |
| 00047 }; |
| 00048 |
| 00049 <span class="comment">//thread function pointer type.</span> |
| <a name="l00050"></a><a class="code" href="oscl__thread_8h.html#a0">00050</a> <span class="keyword">typedef</span> <a class="code" href="osclconfig__proc__unix__android_8h.html#a8">TOsclThreadFuncRet</a>(OSCL_THREAD_DECL *<a class="code" href="oscl__thread_8h.html#a0">TOsclThreadFuncPtr</a>)(TOsclThreadFuncArg); |
| 00051 |
| <a name="l00058"></a><a class="code" href="classOsclThread.html">00058</a> <span class="keyword">class </span><a class="code" href="classOsclThread.html">OsclThread</a> |
| 00059 { |
| 00060 |
| 00061 <span class="keyword">public</span>: |
| 00062 |
| 00066 OSCL_IMPORT_REF <a class="code" href="classOsclThread.html#a0">OsclThread</a>(); |
| 00067 |
| 00071 OSCL_IMPORT_REF <a class="code" href="classOsclThread.html#a1">~OsclThread</a>(); |
| 00072 |
| 00089 OSCL_IMPORT_REF <a class="code" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a> <a class="code" href="classOsclThread.html#a2">Create</a>(<a class="code" href="oscl__thread_8h.html#a0">TOsclThreadFuncPtr</a> func, |
| 00090 int32 stack_size, |
| 00091 TOsclThreadFuncArg argument, |
| 00092 <a class="code" href="oscl__thread_8h.html#a10">OsclThread_State</a> state = <a class="code" href="oscl__thread_8h.html#a10a1">Start_on_creation</a>); |
| 00093 |
| 00102 OSCL_IMPORT_REF <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classOsclThread.html#d0">Exit</a>(<a class="code" href="group__osclbase.html#a25">OsclAny</a>* exitcode); |
| 00103 |
| 00114 OSCL_IMPORT_REF <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classOsclThread.html#d1">EnableKill</a>(); |
| 00115 |
| 00123 OSCL_IMPORT_REF <a class="code" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a> <a class="code" href="classOsclThread.html#a3">GetPriority</a>(<a class="code" href="oscl__thread_8h.html#a11">OsclThreadPriority</a>& refThreadPriority); |
| 00124 |
| 00134 OSCL_IMPORT_REF <a class="code" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a> <a class="code" href="classOsclThread.html#a4">SetPriority</a>(<a class="code" href="oscl__thread_8h.html#a11">OsclThreadPriority</a> ePriority); |
| 00135 |
| 00144 OSCL_IMPORT_REF <a class="code" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a> <a class="code" href="classOsclThread.html#a5">Suspend</a>(); |
| 00145 |
| 00153 OSCL_IMPORT_REF <a class="code" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a> <a class="code" href="classOsclThread.html#a6">Resume</a>(); |
| 00154 |
| 00168 OSCL_IMPORT_REF <a class="code" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a> <a class="code" href="classOsclThread.html#a7">Terminate</a>(<a class="code" href="group__osclbase.html#a25">OsclAny</a>* exitcode); |
| 00169 |
| 00170 |
| 00176 OSCL_IMPORT_REF <span class="keyword">static</span> <a class="code" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a> <a class="code" href="classOsclThread.html#d2">GetId</a>(TOsclThreadId& refThreadId); |
| 00177 |
| 00183 OSCL_IMPORT_REF <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classOsclThread.html#d3">CompareId</a>(TOsclThreadId &t1, TOsclThreadId &t2); |
| 00184 |
| 00189 OSCL_IMPORT_REF <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classOsclThread.html#d4">SleepMillisec</a>(<span class="keyword">const</span> int32 msec); |
| 00190 |
| 00191 <span class="keyword">private</span>: |
| 00192 |
| 00200 <a class="code" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a> MapOsclError(int16 error); |
| 00201 |
| 00202 |
| 00203 TOsclMutexObject mutex; |
| 00204 TOsclConditionObject condition; |
| 00205 uint8 suspend; |
| 00206 |
| 00207 |
| 00208 |
| 00209 TOsclThreadObject ObjThread; |
| 00210 <span class="keywordtype">bool</span> bCreated; |
| 00211 |
| 00212 }; |
| 00213 |
| 00214 <span class="preprocessor">#endif</span> |
| 00215 <span class="preprocessor"></span> |
| </pre></div><hr size="1"><img src="pvlogo_small.jpg"><address style="align: right;"><small>OSCL API</small> |
| <address style="align: left;"><small>Posting Version: OPENCORE_20090310 </small> |
| </small></address> |
| </body> |
| </html> |