I have a few questions on DetachThread.
Does DetachThread() need to be run on the same thread as
AttachThread()? Or, if you have the RexxThreadContext pointer, can
you invoke DetachThread() from a different thread? I've been assuming
you could invoke DetachThread() from some other, second thread.
My second question is dependent on the answer to the first question.
Assuming you can invoke DetachThread() from a second thread, what
happens if you do a DetachThread() in a second thread after a Rexx
method has been started on the thread context, but hasn't returned?
Something like:
thread 1 (same thread as thread context was obtained through
AttachThread. dlgProcContext is the thread context pointer.)
RexxObjectPtr result = pcpbd->dlgProcContext)->SendMessage(myObj,
"MYMETHOD", args);
thread 2
if ( pcpbd->dlgProcContext != NULL )
{
pcpbd->dlgProcContext->DetachThread();
pcpbd->dlgProcContext = NULL;
}
In thread 2, it is guaranteed that the SendMessage() is invoked before
any DetachThread() is done. But, it is not guaranteed that it has
returned from myMethod(). Is that going to cause problems? When, it
does return, dlgProcContext will not be used again.
--
Mark Miesfeld
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel