Re: [Quickfix-users] Peforming application-specific actions at creation of the initiator thread
Brought to you by:
orenmnero
|
From: Oren M. <or...@qu...> - 2004-04-26 16:33:23
|
Yeah, I see that. I'll probably change that code to something like
this.
onStop();
if( m_threadid );
thread_join( m_threadid );
m_threadid = 0;
On Apr 26, 2004, at 11:10 AM, Igo...@ub... wrote:
>
> OK, just looked at that, but it still doesn't seem that simple, as in
> this
> case it seems I would have no way to terminate the thread that's
> calling
> block().
>
> The block() method ends up SocketInitiator::onStart(), calling
> SocketConnector::block() in a loop that won't exit until the private
> flag
> Initiator::m_stop is set to true. The only way to do that is to call
> Initiator::stop(), but stop() won't do anything unless the thread is
> created by Initiator::start(), as it checks the private variable
> Initiator::m_threadid, set by Initiator::start().
>
> Cheers,
> Igor
>
> ------- Oren Miller <or...@qu...> -------
> Well, start() is really a convenience method. What you should do if
> you want more control over the thread is to spawn one yourself and call
> block() on the initiator instead. This will run the initiator entirely
> in one thread and give you control over code that is run at startup and
> wind down of that thread.
>
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
> For a limited time only, get FREE Ground shipping on all orders of $35
> or more. Hurry up and shop folks, this offer expires April 30th!
> http://www.thinkgeek.com/freeshipping/?cpg=12297
> _______________________________________________
> Quickfix-users mailing list
> Qui...@li...
> https://lists.sourceforge.net/lists/listinfo/quickfix-users
>
|