📄 class_plugin_thread_pool_1_1_thread_chain.html
字号:
<td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"><code> [inline]</code></td> </tr> </table></div><div class="memdoc"><p>reference couting <p><p>Definition at line <a class="el" href="_thread_chain_8h-source.html#l00316">316</a> of file <a class="el" href="_thread_chain_8h-source.html">ThreadChain.h</a>.<p>References <a class="el" href="_thread_chain_8h-source.html#l00363">PluginThreadPool::ThreadChain< T >::m_ref</a>.<p>Referenced by <a class="el" href="_thread_chain_8h-source.html#l00036">PluginThreadPool::ThreadChain< T >::ThreadChain()</a>.</div></div><p><a class="anchor" name="67fd435e62ebf5d5a225270f2e336270"></a><!-- doxytag: member="PluginThreadPool::ThreadChain::canHandle" ref="67fd435e62ebf5d5a225270f2e336270" args="()" --><div class="memitem"><div class="memproto"><div class="memtemplate">template<typename T> </div> <table class="memname"> <tr> <td class="memname">bool <a class="el" href="class_plugin_thread_pool_1_1_thread_chain.html">PluginThreadPool::ThreadChain</a>< T >::canHandle </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"><code> [inline]</code></td> </tr> </table></div><div class="memdoc"><p>This method just checks if ITS Thread is already busy processing a request If its thread is free it signals an event which sets it thread to hand the request and it returns true; <p>if the associated thread is already processing a request<p>Means there is no next thread so check if threads should be added if the thread count is already max nothing to be done<p>acp check this<p>create a new thread<p>Only add one thread at a time<p>If the thread count is already max nothing to be done<p>max thread count reached<p>Else see if the next obejct in the chain is free to handle the request <p>Definition at line <a class="el" href="_thread_chain_8h-source.html#l00062">62</a> of file <a class="el" href="_thread_chain_8h-source.html">ThreadChain.h</a>.<p>References <a class="el" href="_thread_chain_8h-source.html#l00357">PluginThreadPool::ThreadChain< T >::busy</a>, <a class="el" href="_thread_chain_8h-source.html#l00062">PluginThreadPool::ThreadChain< T >::canHandle()</a>, <a class="el" href="_thread_chain_8h-source.html#l00362">PluginThreadPool::ThreadChain< T >::g_Event</a>, <a class="el" href="_thread_chain_8h-source.html#l00355">PluginThreadPool::ThreadChain< T >::next</a>, and <a class="el" href="_thread_chain_8h-source.html#l00366">PluginThreadPool::ThreadChain< T >::threadpool</a>.<p>Referenced by <a class="el" href="_thread_chain_8h-source.html#l00062">PluginThreadPool::ThreadChain< T >::canHandle()</a>.</div></div><p><a class="anchor" name="39ed823eaf29897d799d283daee04c63"></a><!-- doxytag: member="PluginThreadPool::ThreadChain::GetNext" ref="39ed823eaf29897d799d283daee04c63" args="()" --><div class="memitem"><div class="memproto"><div class="memtemplate">template<typename T> </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="class_plugin_thread_pool_1_1_thread_chain.html">ThreadChain</a>* <a class="el" href="class_plugin_thread_pool_1_1_thread_chain.html">PluginThreadPool::ThreadChain</a>< T >::GetNext </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"><code> [inline]</code></td> </tr> </table></div><div class="memdoc"><p>Get the next object in the chain. <p><p>Definition at line <a class="el" href="_thread_chain_8h-source.html#l00251">251</a> of file <a class="el" href="_thread_chain_8h-source.html">ThreadChain.h</a>.<p>References <a class="el" href="_thread_chain_8h-source.html#l00355">PluginThreadPool::ThreadChain< T >::next</a>.<p>Referenced by <a class="el" href="_thread_chain_8h-source.html#l00196">PluginThreadPool::ThreadChain< T >::HandleHungThreads()</a>.</div></div><p><a class="anchor" name="7ae01cce8c7c6f9d63c124194bd9d883"></a><!-- doxytag: member="PluginThreadPool::ThreadChain::HandleHungThreads" ref="7ae01cce8c7c6f9d63c124194bd9d883" args="(ThreadChain< T > *prev)" --><div class="memitem"><div class="memproto"><div class="memtemplate">template<typename T> </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="class_plugin_thread_pool_1_1_thread_chain.html">PluginThreadPool::ThreadChain</a>< T >::HandleHungThreads </td> <td>(</td> <td class="paramtype"><a class="el" href="class_plugin_thread_pool_1_1_thread_chain.html">ThreadChain</a>< T > * </td> <td class="paramname"> <em>prev</em> </td> <td> ) </td> <td width="100%"><code> [inline]</code></td> </tr> </table></div><div class="memdoc"><p>The method to handle the hung threads. <p><p>printf("In HandleHungThreads\n");<p>case if root is hanging<p>propogate to the next object<p>if this is a hung thread that is waking up<p>then release it<p>printf("Out HandleHungThreads\n"); <p>Definition at line <a class="el" href="_thread_chain_8h-source.html#l00196">196</a> of file <a class="el" href="_thread_chain_8h-source.html">ThreadChain.h</a>.<p>References <a class="el" href="_thread_chain_8h-source.html#l00251">PluginThreadPool::ThreadChain< T >::GetNext()</a>, <a class="el" href="_thread_chain_8h-source.html#l00196">PluginThreadPool::ThreadChain< T >::HandleHungThreads()</a>, <a class="el" href="_thread_chain_8h-source.html#l00258">PluginThreadPool::ThreadChain< T >::IsHung()</a>, <a class="el" href="_thread_chain_8h-source.html#l00355">PluginThreadPool::ThreadChain< T >::next</a>, <a class="el" href="_thread_chain_8h-source.html#l00321">PluginThreadPool::ThreadChain< T >::Release()</a>, <a class="el" href="_thread_chain_8h-source.html#l00284">PluginThreadPool::ThreadChain< T >::ReleaseIdleThread()</a>, <a class="el" href="_thread_chain_8h-source.html#l00364">PluginThreadPool::ThreadChain< T >::threadId</a>, and <a class="el" href="_thread_chain_8h-source.html#l00366">PluginThreadPool::ThreadChain< T >::threadpool</a>.<p>Referenced by <a class="el" href="_thread_chain_8h-source.html#l00196">PluginThreadPool::ThreadChain< T >::HandleHungThreads()</a>.</div></div><p><a class="anchor" name="313163d771692b7ce2873674fc4553c9"></a><!-- doxytag: member="PluginThreadPool::ThreadChain::HandleRequest" ref="313163d771692b7ce2873674fc4553c9" args="()" --><div class="memitem"><div class="memproto"><div class="memtemplate">template<typename T> </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="class_plugin_thread_pool_1_1_thread_chain.html">PluginThreadPool::ThreadChain</a>< T >::HandleRequest </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"><code> [inline]</code></td> </tr> </table></div><div class="memdoc"><p>This is the method that is called by the thread, it waits for an event note- exceptions thrown by the excecute method are not caught <p>The deleteMe is set in the dtor usually if this threads time out is over<p>This event is signalled from the canHandle mthd<p>Set the start time - for checking if the thread is hang or not<p>Now set that this object as busy-it is going to handle a request<p>printf("Handling a request in thread=%d\n",threadId);<p>there is no need of syncronizhing this as only one thread will be calling GetRequest at a time<p>The time out is in seconds<p>else<p>printf("GetRequest gave null!!");<p>Okay task is over - so set it to not busy state<p>Reset the start time<p>Reset the event to non signalled state<p>end of while(!deleteMe)<p>We are here because the thread has taken more than the timeout value to exceute<p>call the dtor todo - in case of a thread that is permenantly hanging the flow will not reach here, so the handles used by this atleast have to be closed ?? <p>Definition at line <a class="el" href="_thread_chain_8h-source.html#l00118">118</a> of file <a class="el" href="_thread_chain_8h-source.html">ThreadChain.h</a>.<p>References <a class="el" href="_thread_chain_8h-source.html#l00357">PluginThreadPool::ThreadChain< T >::busy</a>, <a class="el" href="_thread_chain_8h-source.html#l00365">PluginThreadPool::ThreadChain< T >::deleteMe</a>, <a class="el" href="_command_8h-source.html#l00191">PluginThreadPool::Command< T >::execute()</a>, <a class="el" href="_thread_chain_8h-source.html#l00362">PluginThreadPool::ThreadChain< T >::g_Event</a>, <a class="el" href="_command_8h-source.html#l00217">PluginThreadPool::Command< T >::GetTimeOut()</a>, <a class="el" href="_thread_chain_8h-source.html#l00360">PluginThreadPool::ThreadChain< T >::lastactivetime</a>, <a class="el" href="_thread_chain_8h-source.html#l00367">PluginThreadPool::ThreadChain< T >::m_timeout</a>, <a class="el" href="_thread_chain_8h-source.html#l00359">PluginThreadPool::ThreadChain< T >::starttime</a>, <a class="el" href="_thread_chain_8h-source.html#l00368">PluginThreadPool::ThreadChain< T >::threadChkMutex</a>, <a class="el" href="_thread_chain_8h-source.html#l00364">PluginThreadPool::ThreadChain< T >::threadId</a>, and <a class="el" href="_thread_chain_8h-source.html#l00366">PluginThreadPool::ThreadChain< T >::threadpool</a>.<p>Referenced by <a class="el" href="_thread_chain_8h-source.html#l00107">PluginThreadPool::ThreadChain< T >::HandleRequestProxy()</a>.</div></div><p><a class="anchor" name="53ecf3b974adabbdf951bfcf73327314"></a><!-- doxytag: member="PluginThreadPool::ThreadChain::HandleRequestProxy" ref="53ecf3b974adabbdf951bfcf73327314" args="(LPVOID param)" --><div class="memitem"><div class="memproto"><div class="memtemplate">template<typename T> </div> <table class="memname"> <tr> <td class="memname">static UINT <a class="el" href="class_plugin_thread_pool_1_1_thread_chain.html">PluginThreadPool::ThreadChain</a>< T >::HandleRequestProxy </td> <td>(</td> <td class="paramtype">LPVOID </td> <td class="paramname"> <em>param</em> </td> <td> ) </td> <td width="100%"><code> [inline, static]</code></td> </tr> </table></div><div class="memdoc"><p>The proxy thread function that call the method-HandleRequest in a thread--- <p>Definition at line <a class="el" href="_thread_chain_8h-source.html#l00107">107</a> of file <a class="el" href="_thread_chain_8h-source.html">ThreadChain.h</a>.<p>References <a class="el" href="_thread_chain_8h-source.html#l00118">PluginThreadPool::ThreadChain< T >::HandleRequest()</a>.<p>Referenced by <a class="el" href="_thread_chain_8h-source.html#l00036">PluginThreadPool::ThreadChain< T >::ThreadChain()</a>.</div></div><p><a class="anchor" name="103d28f4e5269ac50c48450e8b4ba02e"></a><!-- doxytag: member="PluginThreadPool::ThreadChain::IsHung" ref="103d28f4e5269ac50c48450e8b4ba02e" args="()" --><div class="memitem"><div class="memproto"><div class="memtemplate">template<typename T> </div> <table class="memname"> <tr> <td class="memname">bool <a class="el" href="class_plugin_thread_pool_1_1_thread_chain.html">PluginThreadPool::ThreadChain</a>< T >::IsHung </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"><code> [inline]</code></td> </tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -