<div dir="ltr"><div><div><div><div><pre>Hi,<br><br></pre><pre>I have a doubt in the trace lines 340 and 342 below -<br></pre><pre><br> <a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=omniAsyncInvoker">omniAsyncInvoker</a>::<a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=%7EomniAsyncInvoker">~omniAsyncInvoker</a>() {
<a name="L307" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L307">307</a>
<a name="L308" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L308">308</a> pd_lock-><a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=lock">lock</a>();
<a name="L309" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L309">309</a> pd_keep_working = 0;
<a name="L310" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L310">310</a> while (pd_idle_threads) {
<a name="L311" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L311">311</a> <a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=omniAsyncWorker">omniAsyncWorker</a>* <a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=t">t</a> = pd_idle_threads;
<a name="L312" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L312">312</a> pd_idle_threads = <a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=t">t</a>->pd_next;
<a name="L313" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L313">313</a> <a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=t">t</a>->pd_next = 0;
<a name="L314" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L314">314</a> <a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=t">t</a>->pd_in_idle_queue = 0;
<a name="L315" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L315">315</a> <a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=t">t</a>->pd_cond-><a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=signal">signal</a>();
<a name="L316" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L316">316</a> }
<a name="L317" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L317">317</a>
<a name="L318" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L318">318</a> <b><i>// Wait for threads to exit</i></b>
<a name="L319" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L319">319</a> if (pd_totalthreads) {
<a name="L320" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L320">320</a> unsigned long <a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=timeout">timeout</a>, <a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=s">s</a>, <a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=ns">ns</a>;
<a name="L321" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L321">321</a> if (orbParameters::<a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=scanGranularity">scanGranularity</a>)
<a name="L322" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L322">322</a> <a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=timeout">timeout</a> = orbParameters::<a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=scanGranularity">scanGranularity</a>;
<a name="L323" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L323">323</a> else
<a name="L324" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L324">324</a> <a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=timeout">timeout</a> = 5;
<a name="L325" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L325">325</a>
<a name="L326" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L326">326</a> <a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=omni_thread">omni_thread</a>::<a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=get_time">get_time</a>(&<a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=s">s</a>, &<a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=ns">ns</a>, <a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=timeout">timeout</a>);
<a name="L327" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L327">327</a>
<a name="L328" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L328">328</a> if (<a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=omniORB">omniORB</a>::<a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=trace">trace</a>(25)) {
<a name="L329" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L329">329</a> <a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=omniORB">omniORB</a>::<a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=logger">logger</a> <a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=l">l</a>;
<a name="L330" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L330">330</a> <a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=l">l</a> << <i>"Wait for "</i> << pd_totalthreads << <i>" invoker thread"</i>
<a name="L331" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L331">331</a> << <a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=plural">plural</a>(pd_totalthreads) << <i>" to finish.\n"</i>;
<a name="L332" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L332">332</a> }
<a name="L333" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L333">333</a> int go = 1;
<a name="L334" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L334">334</a> while (go && pd_totalthreads) {
<a name="L335" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L335">335</a> go = pd_cond-><a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=timedwait">timedwait</a>(<a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=s">s</a>, <a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=ns">ns</a>);
<a name="L336" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L336">336</a> }
<a name="L337" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L337">337</a> if (<a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=omniORB">omniORB</a>::<a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=trace">trace</a>(25)) {
<a name="L338" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L338">338</a> <a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=omniORB">omniORB</a>::<a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=logger">logger</a> <a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=l">l</a>;
<a name="L339" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L339">339</a> if (go)
<a name="L340" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L340">340</a> <a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=l">l</a> << <i>"Invoker threads finished.\n"</i>;
<a name="L341" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L341">341</a> else
<a name="L342" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L342">342</a> <a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=l">l</a> << <i>"Timed out. "</i> << pd_totalthreads
<a name="L343" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L343">343</a> << <i>" invoker threads remaining.\n"</i>;
<a name="L344" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L344">344</a> }
<a name="L345" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L345">345</a> }
<a name="L346" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L346">346</a> pd_lock-><a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=unlock">unlock</a>();
<a name="L347" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L347">347</a>
<a name="L348" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L348">348</a> <a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=delete">delete</a> pd_cond;
<a name="L349" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L349">349</a> <a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=delete">delete</a> pd_lock;
<a name="L350" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L350">350</a> <a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=omniORB">omniORB</a>::<a href="http://pcatd12.cern.ch/lxr/ident?v=tdaq-03-00-01;i=logs">logs</a>(10, <i>"AsyncInvoker: deleted."</i>);
<a name="L351" href="http://pcatd12.cern.ch/lxr/source/omni/src/lib/omniORB/orbcore/invoker.cc?v=tdaq-03-00-01#L351">351</a> }</pre><br></div>Here, the timedwait() will return either 0, 1 or -1. i.e. It returns 0 if successfully signaled, 1 if time expired and -1 in case of error.<br>
<br></div>now, as per the trace code above, if the "go" parameter is true i.e. 1 it will print "Invoker thread finished", though 1 means time expired.<br><br></div>and else part will be executed if "go" is 0 or -1 i.e. both success or failure, we are saying trace - "Timed out", <br>
<br></div>Isn;t it should be other way round?<br><div><div><div><br><div>-- <br>Regards,<br>Sheena
</div></div></div></div></div>