Hi
Currently, we don't have a uniform way to get the current thread id from a
rexx script.
Under Windows : SysQueryProcess("TID")
if (stricmp(option, "TID") == 0)
{
return context->WholeNumber(GetCurrentThreadId());
}
Under Unix : Sysgettid()
pthread_t tid = pthread_self();
return context->UnsignedInt64ToObject((uint64_t)tid);
I'd like to add support for SysQueryProcess("TID") under Unix.
If I follow the current implementation, I should write something like that :
if (!strcasecmp(args[0].strptr, "TID"))
{
sprintf(retstr->strptr, "%d", pthread_self());
retstr->strlength = strlen(retstr->strptr);
return VALID_ROUTINE; /* no error on call */
}
Any objection ?
Regards
Jean-Louis
------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel