| <!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_scheduler_readyq.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_scheduler_readyq.h</h1><a href="oscl__scheduler__readyq_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 |
| 00013 <span class="preprocessor">#ifndef OSCL_SCHEDULER_READYQ_H_INCLUDED</span> |
| 00014 <span class="preprocessor"></span><span class="preprocessor">#define OSCL_SCHEDULER_READYQ_H_INCLUDED</span> |
| 00015 <span class="preprocessor"></span> |
| 00016 <span class="preprocessor">#ifndef OSCL_SCHEDULER_TYPES_H_INCLUDED</span> |
| 00017 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__scheduler__types_8h.html">oscl_scheduler_types.h</a>"</span> |
| 00018 <span class="preprocessor">#endif</span> |
| 00019 <span class="preprocessor"></span><span class="preprocessor">#ifndef OSCL_SCHEDULER_TUNEABLES_H_INCLUDED</span> |
| 00020 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__scheduler__tuneables_8h.html">oscl_scheduler_tuneables.h</a>"</span> |
| 00021 <span class="preprocessor">#endif</span> |
| 00022 <span class="preprocessor"></span> |
| 00023 |
| 00024 <span class="preprocessor">#ifndef OSCL_PRIQUEUE_H_INCLUDED</span> |
| 00025 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__priqueue_8h.html">oscl_priqueue.h</a>"</span> |
| 00026 <span class="preprocessor">#endif</span> |
| 00027 <span class="preprocessor"></span><span class="preprocessor">#ifndef OSCL_BASE_ALLOC_H_INCLUDED</span> |
| 00028 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__base__alloc_8h.html">oscl_base_alloc.h</a>"</span> |
| 00029 <span class="preprocessor">#endif</span> |
| 00030 <span class="preprocessor"></span><span class="preprocessor">#ifndef OSCL_SEMAPHORE_H_INCLUDED</span> |
| 00031 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__semaphore_8h.html">oscl_semaphore.h</a>"</span> |
| 00032 <span class="preprocessor">#endif</span> |
| 00033 <span class="preprocessor"></span><span class="preprocessor">#ifndef OSCL_MEM_H_INCLUDED</span> |
| 00034 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__mem_8h.html">oscl_mem.h</a>"</span> |
| 00035 <span class="preprocessor">#endif</span> |
| 00036 <span class="preprocessor"></span><span class="preprocessor">#ifndef OSCL_MUTEX_H_INCLUDED</span> |
| 00037 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__mutex_8h.html">oscl_mutex.h</a>"</span> |
| 00038 <span class="preprocessor">#endif</span> |
| 00039 <span class="preprocessor"></span><span class="preprocessor">#ifndef OSCL_STRING_CONTAINERS_H_INCLUDED</span> |
| 00040 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__string__containers_8h.html">oscl_string_containers.h</a>"</span> |
| 00041 <span class="preprocessor">#endif</span> |
| 00042 <span class="preprocessor"></span> |
| 00043 <span class="keyword">class </span><a class="code" href="classPVActiveBase.html">PVActiveBase</a>; |
| 00044 |
| <a name="l00045"></a><a class="code" href="classOsclReadyAlloc.html">00045</a> <span class="keyword">class </span><a class="code" href="classOsclReadyAlloc.html">OsclReadyAlloc</a>: <span class="keyword">public</span> <a class="code" href="classOscl__DefAlloc.html">Oscl_DefAlloc</a> |
| 00046 { |
| 00047 <span class="keyword">public</span>: |
| 00048 <a class="code" href="group__osclbase.html#a25">OsclAny</a>* <a class="code" href="classOsclReadyAlloc.html#a0">allocate</a>(<span class="keyword">const</span> uint32 size) ; |
| 00049 <a class="code" href="group__osclbase.html#a25">OsclAny</a>* <a class="code" href="classOsclReadyAlloc.html#a1">allocate_fl</a>(<span class="keyword">const</span> uint32 size, <span class="keyword">const</span> <span class="keywordtype">char</span> * file_name, <span class="keyword">const</span> <span class="keywordtype">int</span> line_num); |
| 00050 <span class="keywordtype">void</span> <a class="code" href="classOsclReadyAlloc.html#a2">deallocate</a>(<a class="code" href="group__osclbase.html#a25">OsclAny</a>* p) ; |
| 00051 <span class="keyword">private</span>: |
| 00052 <a class="code" href="classOsclMemAllocator.html">OsclMemAllocator</a> iBasicAlloc; |
| 00053 }; |
| 00054 |
| <a name="l00055"></a><a class="code" href="group__osclproc.html#a4">00055</a> <span class="keyword">typedef</span> <a class="code" href="classPVActiveBase.html">PVActiveBase</a>* <a class="code" href="classPVActiveBase.html">TOsclReady</a>; |
| 00056 |
| <a name="l00057"></a><a class="code" href="classOsclReadyCompare.html">00057</a> <span class="keyword">class </span><a class="code" href="classOsclReadyCompare.html">OsclReadyCompare</a> |
| 00058 { |
| 00059 <span class="keyword">public</span>: |
| 00060 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classOsclReadyCompare.html#d0">compare</a>(TOsclReady& a, TOsclReady& b) ; |
| 00061 }; |
| <a name="l00062"></a><a class="code" href="classOsclTimerCompare.html">00062</a> <span class="keyword">class </span><a class="code" href="classOsclTimerCompare.html">OsclTimerCompare</a> |
| 00063 { |
| 00064 <span class="keyword">public</span>: |
| 00065 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classOsclTimerCompare.html#d0">compare</a>(TOsclReady& a, TOsclReady& b) ; |
| 00066 }; |
| 00067 |
| 00073 <span class="keyword">class </span><a class="code" href="classPVLogger.html">PVLogger</a>; |
| 00074 <span class="keyword">class </span><a class="code" href="classOsclSchedulerObserver.html">OsclSchedulerObserver</a>; |
| <a name="l00075"></a><a class="code" href="classOsclReadyQ.html">00075</a> <span class="keyword">class </span><a class="code" href="classOsclReadyQ.html">OsclReadyQ</a> |
| 00076 : <span class="keyword">public</span> <a class="code" href="classOsclPriorityQueue.html">OsclPriorityQueue</a><TOsclReady, OsclReadyAlloc, Oscl_Vector<TOsclReady, OsclReadyAlloc>, OsclReadyCompare> |
| 00077 { |
| 00078 <span class="keyword">public</span>: |
| 00079 <span class="keywordtype">void</span> <a class="code" href="classOsclReadyQ.html#a0">Construct</a>(<span class="keywordtype">int</span>); |
| 00080 <span class="keywordtype">void</span> <a class="code" href="classOsclReadyQ.html#a1">ThreadLogon</a>(); |
| 00081 <span class="keywordtype">void</span> <a class="code" href="classOsclReadyQ.html#a2">ThreadLogoff</a>(); |
| 00082 |
| 00083 <span class="keywordtype">void</span> <a class="code" href="classOsclReadyQ.html#a3">Remove</a>(TOsclReady); |
| 00084 |
| 00085 <span class="keywordtype">bool</span> <a class="code" href="classOsclReadyQ.html#a4">IsIn</a>(TOsclReady); |
| 00086 |
| <a name="l00087"></a><a class="code" href="classOsclReadyQ.html#a5">00087</a> uint32 <a class="code" href="classOsclReadyQ.html#a5">Depth</a>() |
| 00088 { |
| 00089 <span class="keywordflow">return</span> <a class="code" href="classOsclPriorityQueue.html#a1">size</a>(); |
| 00090 } |
| 00091 |
| 00092 TOsclReady <a class="code" href="classOsclReadyQ.html#a6">PopTop</a>(); |
| 00093 TOsclReady <a class="code" href="classOsclReadyQ.html#a7">Top</a>(); |
| 00094 |
| 00095 TOsclReady <a class="code" href="classOsclReadyQ.html#a8">WaitAndPopTop</a>(); |
| 00096 TOsclReady <a class="code" href="classOsclReadyQ.html#a8">WaitAndPopTop</a>(uint32); |
| 00097 |
| 00098 int32 <a class="code" href="classOsclReadyQ.html#a10">PendComplete</a>(<a class="code" href="classPVActiveBase.html">PVActiveBase</a> *pvbase, int32 aReason); |
| 00099 int32 <a class="code" href="classOsclReadyQ.html#a11">WaitForRequestComplete</a>(<a class="code" href="classPVActiveBase.html">PVActiveBase</a>*); |
| 00100 |
| 00101 <span class="comment">//For non-blocking scheduler observer support</span> |
| 00102 <span class="keywordtype">void</span> <a class="code" href="classOsclReadyQ.html#a12">RegisterForCallback</a>(<a class="code" href="classOsclSchedulerObserver.html">OsclSchedulerObserver</a>* aCallback, <a class="code" href="group__osclbase.html#a25">OsclAny</a>* aCallbackContext); |
| 00103 <span class="keywordtype">void</span> <a class="code" href="classOsclReadyQ.html#a13">TimerCallback</a>(uint32 aDelayMicrosec); |
| <a name="l00104"></a><a class="code" href="classOsclReadyQ.html#a14">00104</a> <a class="code" href="classOsclSchedulerObserver.html">OsclSchedulerObserver</a>* <a class="code" href="classOsclReadyQ.html#a14">Callback</a>() |
| 00105 { |
| 00106 <span class="keywordflow">return</span> iCallback; |
| 00107 } |
| 00108 |
| 00109 <span class="keyword">private</span>: |
| 00110 TOsclReady PopTopAfterWait(); |
| 00111 |
| 00112 <span class="comment">//mutex for thread protection</span> |
| 00113 <a class="code" href="classOsclMutex.html">OsclNoYieldMutex</a> iCrit; |
| 00114 |
| 00115 <span class="comment">//this semaphore tracks the queue size. it is used to</span> |
| 00116 <span class="comment">//regulate the scheduling loop when running in blocking mode.</span> |
| 00117 <a class="code" href="classOsclSemaphore.html">OsclSemaphore</a> iSem; |
| 00118 |
| 00119 <span class="comment">//a sequence number needed to maintain FIFO sorting order in oscl pri queue.</span> |
| 00120 uint32 iSeqNumCounter; |
| 00121 |
| 00122 <span class="comment">//For non-blocking scheduler observer support</span> |
| 00123 <a class="code" href="classOsclSchedulerObserver.html">OsclSchedulerObserver</a>* iCallback; |
| 00124 <a class="code" href="group__osclbase.html#a25">OsclAny</a>* iCallbackContext; |
| 00125 }; |
| 00126 |
| 00127 <span class="comment">/*</span> |
| 00128 <span class="comment">** A non-thread-safe queue for holding pending timers.</span> |
| 00129 <span class="comment">*/</span> |
| <a name="l00130"></a><a class="code" href="classOsclTimerQ.html">00130</a> <span class="keyword">class </span><a class="code" href="classOsclTimerQ.html">OsclTimerQ</a> |
| 00131 : <span class="keyword">public</span> <a class="code" href="classOsclPriorityQueue.html">OsclPriorityQueue</a><TOsclReady, OsclReadyAlloc, Oscl_Vector<TOsclReady, OsclReadyAlloc>, OsclTimerCompare> |
| 00132 { |
| 00133 <span class="keyword">public</span>: |
| 00134 <span class="keywordtype">void</span> <a class="code" href="classOsclTimerQ.html#a0">Construct</a>(<span class="keywordtype">int</span>); |
| 00135 <span class="keywordtype">void</span> <a class="code" href="classOsclTimerQ.html#a1">Add</a>(TOsclReady); |
| 00136 <span class="keywordtype">void</span> <a class="code" href="classOsclTimerQ.html#a2">Remove</a>(TOsclReady); |
| 00137 TOsclReady <a class="code" href="classOsclTimerQ.html#a3">PopTop</a>(); |
| 00138 TOsclReady <a class="code" href="classOsclTimerQ.html#a4">Top</a>(); |
| 00139 <span class="keywordtype">void</span> <a class="code" href="classOsclTimerQ.html#a5">Pop</a>(TOsclReady); |
| 00140 <span class="keywordtype">bool</span> <a class="code" href="classOsclTimerQ.html#a6">IsIn</a>(TOsclReady); |
| 00141 <span class="keyword">private</span>: |
| 00142 <span class="comment">//a sequence number needed to maintain FIFO sorting order in oscl pri queue.</span> |
| 00143 uint32 iSeqNumCounter; |
| 00144 }; |
| 00145 |
| <a name="l00149"></a><a class="code" href="classTReadyQueLink.html">00149</a> <span class="keyword">class </span><a class="code" href="classTReadyQueLink.html">TReadyQueLink</a> |
| 00150 { |
| 00151 <span class="keyword">public</span>: |
| <a name="l00152"></a><a class="code" href="classTReadyQueLink.html#a0">00152</a> <a class="code" href="classTReadyQueLink.html#a0">TReadyQueLink</a>() |
| 00153 { |
| 00154 <a class="code" href="classTReadyQueLink.html#m0">iAOPriority</a> = 0; |
| 00155 <a class="code" href="classTReadyQueLink.html#m1">iTimeToRunTicks</a> = 0; |
| 00156 <a class="code" href="classTReadyQueLink.html#m3">iSeqNum</a> = 0; |
| 00157 <a class="code" href="classTReadyQueLink.html#m4">iIsIn</a> = <a class="code" href="group__osclbase.html#a81">NULL</a>; |
| 00158 } |
| 00159 |
| <a name="l00160"></a><a class="code" href="classTReadyQueLink.html#m0">00160</a> int32 <a class="code" href="classTReadyQueLink.html#m0">iAOPriority</a>;<span class="comment">//scheduling priority</span> |
| <a name="l00161"></a><a class="code" href="classTReadyQueLink.html#m1">00161</a> uint32 <a class="code" href="classTReadyQueLink.html#m1">iTimeToRunTicks</a>;<span class="comment">//for timers, this is the time to run in ticks.</span> |
| <a name="l00162"></a><a class="code" href="classTReadyQueLink.html#m2">00162</a> uint32 <a class="code" href="classTReadyQueLink.html#m2">iTimeQueuedTicks</a>;<span class="comment">//the time when the AO was queued, in ticks.</span> |
| <a name="l00163"></a><a class="code" href="classTReadyQueLink.html#m3">00163</a> uint32 <a class="code" href="classTReadyQueLink.html#m3">iSeqNum</a>;<span class="comment">//sequence number for oscl pri queue.</span> |
| <a name="l00164"></a><a class="code" href="classTReadyQueLink.html#m4">00164</a> <a class="code" href="group__osclbase.html#a25">OsclAny</a>* <a class="code" href="classTReadyQueLink.html#m4">iIsIn</a>;<span class="comment">//pointer to the queue we're in, cast as a void*</span> |
| 00165 |
| 00166 }; |
| 00167 |
| 00168 <span class="preprocessor">#endif</span> |
| 00169 <span class="preprocessor"></span> |
| 00170 |
| </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> |