• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3<title>oscl_thread.h Source File</title>
4<link href="doxygen.css" rel="stylesheet" type="text/css">
5</head><body>
6<!-- Generated by Doxygen 1.2.18 -->
7<center>
8<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="modules.html">Modules</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Data Structures</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Data Fields</a> &nbsp; <a class="qindex" href="globals.html">Globals</a> &nbsp; </center>
9<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>
1000002 <span class="comment">// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</span>
1100003
1200004 <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>
1300005
1400006 <span class="comment">// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</span>
1500007
1600013 <span class="comment">// Definition file for OSCL Threads</span>
1700014 <span class="preprocessor">#ifndef OSCL_THREAD_H_INCLUDED</span>
1800015 <span class="preprocessor"></span><span class="preprocessor">#define OSCL_THREAD_H_INCLUDED</span>
1900016 <span class="preprocessor"></span>
2000017 <span class="preprocessor">#ifndef OSCLCONFIG_PROC_H_INCLUDED</span>
2100018 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="osclconfig__proc_8h.html">osclconfig_proc.h</a>"</span>
2200019 <span class="preprocessor">#endif</span>
2300020 <span class="preprocessor"></span>
2400021 <span class="preprocessor">#ifndef OSCL_PROCSTATUS_H_INCLUDED</span>
2500022 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__procstatus_8h.html">oscl_procstatus.h</a>"</span>
2600023 <span class="preprocessor">#endif</span>
2700024 <span class="preprocessor"></span>
2800025 <span class="preprocessor">#ifndef OSCL_BASE_H_INCLUDED</span>
2900026 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__base_8h.html">oscl_base.h</a>"</span>
3000027 <span class="preprocessor">#endif</span>
3100028 <span class="preprocessor"></span>
3200029
3300030 <span class="comment">// Thread state on creation</span>
34<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>
3500032 {
3600033     <a class="code" href="oscl__thread_8h.html#a10a1">Start_on_creation</a>
3700034     , <a class="code" href="oscl__thread_8h.html#a10a2">Suspend_on_creation</a>
3800035 };
3900036
4000037 <span class="comment">// Enumerated Priority Values</span>
41<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>
4200039 {
4300040     <a class="code" href="oscl__thread_8h.html#a11a3">ThreadPriorityLowest</a>
4400041     , <a class="code" href="oscl__thread_8h.html#a11a4">ThreadPriorityLow</a>
4500042     , <a class="code" href="oscl__thread_8h.html#a11a5">ThreadPriorityBelowNormal</a>
4600043     , <a class="code" href="oscl__thread_8h.html#a11a6">ThreadPriorityNormal</a>
4700044     , <a class="code" href="oscl__thread_8h.html#a11a7">ThreadPriorityAboveNormal</a>
4800045     , <a class="code" href="oscl__thread_8h.html#a11a8">ThreadPriorityHighest</a>
4900046     , <a class="code" href="oscl__thread_8h.html#a11a9">ThreadPriorityTimeCritical</a>
5000047 };
5100048
5200049 <span class="comment">//thread function pointer type.</span>
53<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);
5400051
55<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>
5600059 {
5700060
5800061     <span class="keyword">public</span>:
5900062
6000066         OSCL_IMPORT_REF <a class="code" href="classOsclThread.html#a0">OsclThread</a>();
6100067
6200071         OSCL_IMPORT_REF <a class="code" href="classOsclThread.html#a1">~OsclThread</a>();
6300072
6400089         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,
6500090                 int32 stack_size,
6600091                 TOsclThreadFuncArg argument,
6700092                 <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>);
6800093
6900102         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);
7000103
7100114         OSCL_IMPORT_REF <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classOsclThread.html#d1">EnableKill</a>();
7200115
7300123         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>&amp; refThreadPriority);
7400124
7500134         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);
7600135
7700144         OSCL_IMPORT_REF <a class="code" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a> <a class="code" href="classOsclThread.html#a5">Suspend</a>();
7800145
7900153         OSCL_IMPORT_REF <a class="code" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a> <a class="code" href="classOsclThread.html#a6">Resume</a>();
8000154
8100168         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);
8200169
8300170
8400176         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&amp; refThreadId);
8500177
8600183         OSCL_IMPORT_REF <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classOsclThread.html#d3">CompareId</a>(TOsclThreadId &amp;t1, TOsclThreadId &amp;t2);
8700184
8800189         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);
8900190
9000191     <span class="keyword">private</span>:
9100192
9200200         <a class="code" href="classOsclProcStatus.html#s35">OsclProcStatus::eOsclProcError</a> MapOsclError(int16 error);
9300201
9400202
9500203         TOsclMutexObject mutex;
9600204         TOsclConditionObject  condition;
9700205         uint8 suspend;
9800206
9900207
10000208
10100209         TOsclThreadObject ObjThread;
10200210         <span class="keywordtype">bool</span> bCreated;
10300211
10400212 };
10500213
10600214 <span class="preprocessor">#endif</span>
10700215 <span class="preprocessor"></span>
108</pre></div><hr size="1"><img src="pvlogo_small.jpg"><address style="align: right;"><small>OSCL API</small>
109<address style="align: left;"><small>Posting Version: OPENCORE_20090310 </small>
110</small></address>
111</body>
112</html>
113