Przemyslaw,

I've not tested this code, but something like this should give you the thread 
id.

unsigned long _gettid()
{
   PTIB   ptib = NULL;
   APIRET rc;

   rc = DosGetInfoBlocks(&ptib, NULL);

   return ptib->tib_ptib2->tib2_ultid;
}

Hope this help.

Maurilio.

Przemyslaw Czerpak wrote:
> On Sun, 02 Nov 2008, David Arturo Macias Corona wrote:
> 
> Hi David,
> 
>> Current Harbour code compile fine with gcc335 with just well known warnings
> 
> Thanks,
> 
>> With OpenWatcom 1.7:
>> - Screen output
>> -----------------------
>> make[3]: *** [hbmd5.obj] Error 8
> 
> ../../hbmd5.c(328): Error! E473: col(22) function argument(s) do not match 
> those in prototype
> ../../hbmd5.c(328): Note! N392: col(22) definition: 'unsigned long 
> hb_fsReadLarge( int, char *, unsigned long )'
> 
> And we have a problem.
> In OpenWatcom header files BYTE is defined as:
>    typedef char            BYTE, *PBYTE, *NPBYTE;
> By default in OpenWatcom 'char' is unsigned but looks that it does not
> like such conversion. I hope that you haven't enabled -j OpenWatcom switch.
> It will break final binaries. Unfortunately we are using BYTE as synonym
> of 'unsigned char' in many places. I introduced UCHAR / SCHAR and
> systematically update BYTE used in number context to UCHAR but there is
> still a lot of code which have to be updated.
> In this case it should not be a problem because it's buffer so I'll add
> casting which will pacify the warnings/error message but we should keep
> in mind that BYTE in some platforms can be signed and we should continue
> code updating. The same is with pure 'char' casting. It can be signed or
> unsigned type, it's platform/C compiler dependent so we always should
> use 'unsigned char' (UCHAR) or 'signed char' (SCHAR) if sign is important.
> But this I fixed few years ago and now it's only reminder for new code.
> 
>> make[3]: *** [thread.obj] Error 8
> 
> ../../thread.c(1240): Error! E029: col(60) symbol '_gettid' has not been 
> declared
> 
> _gettid() is GCC local function.
> I do not see function which returns directly thread ID in OS2 API.
> Probably it can be extracted from TIB structure returned by
> DosGetInfoBlocks(). I cannot find simpler method. Maurilio can you help?
> 
> best regards,
> Przemek
> _______________________________________________
> Harbour mailing list
> Harbour@harbour-project.org
> http://lists.harbour-project.org/mailman/listinfo/harbour
> 

-- 
 __________
|  |  | |__| Maurilio Longo
|_|_|_|____| farmaconsult s.r.l.


_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to