On Wednesday 13 February 2013 00:17:52 Graeme Geldenhuys wrote:
> On 2013-02-12 21:54, Martin Schreiber wrote:
> > Where is tthreadid for freebsd defined? I could not find it in rtl.
>
> ------------[ rtl/bsd/sysosh.inc ]--------------------
>
> type
>   { fd are int in C also for 64bit targets (x86_64) }
>   THandle = Longint;
>   TThreadRec = record end;
>   TThreadID  = ^TThreadRec;
>
>   { pthread_mutex_t }
>   PRTLCriticalSection = ^TRTLCriticalSection;
>   TRTLCriticalSection = {$i pmutext.inc}
>
> ----------------------[ end ]------------------------
>
Thanks, double spaces before the '='. :-)
>
> Please see the messages I posted in fpc-devel for more details about all
> the FPC issues with FreeBSD.

One of the reasons I more like to rely on libc than on FPC RTL.

> TThreadID is a pointer to an a opaque type 
> (it can be anything - so no assumptions can be made). So I simply casted
> GetCurrentThreadID to PtrUInt, so I can treat the pointer value as a
> "thread id". Many libraries like OpenSSL etc do the same under FreeBSD.

MSEgui does the same anyway:
"
 threadty = ptruint;
[...]
 threadinfoty = record
  id: threadty;
  threadproc: internalthreadprocty;
  stacksize: ptruint;
  platformdata: array[0..3] of pointer;
 end;
"
So we probably get a step further with git master 
8c4ab2580ae07a06640541245fed50dc8da12690 where I added explicit conversions.

Martin

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to