Re: [fpc-devel] CSuspendThread/CResumeThread

2006-11-08 Thread Michael Van Canneyt
On Wed, 8 Nov 2006, Michael Schnell wrote: Jonas Maebe wrote: Does anyone see a problem with the following CSuspendThread/CResumeThread implementations? 1) This of course is the Linux version. Are the other implementation already in place so that the result is platform independent

Re: [fpc-devel] CSuspendThread/CResumeThread

2006-11-08 Thread Jonas Maebe
On 8 nov 2006, at 10:05, Michael Schnell wrote: Does anyone see a problem with the following CSuspendThread/ CResumeThread implementations? 1) This of course is the Linux version. No, it's the generic *nix version (i.e., also used for Free/Net/ OpenBSD, Darwin and Solaris). Are the

Re: [fpc-devel] CSuspendThread/CResumeThread

2006-11-08 Thread Ales Katona
Jonas currently fpc2.1.1 doesn't compile on 2.1.1 with: rtl/units/i386-freebsd -di386 -dRELEASE ../unix/cthreads.pp cthreads.pp(252,42) Error: Incompatible type for arg no. 1: Got LongInt, expected Pointer Note: unixtypes thread_t = pointer pthreads.inc thread_t (BSD and linux) = cInt {linux is

Re: [fpc-devel] CSuspendThread/CResumeThread

2006-11-08 Thread Michael Van Canneyt
On Wed, 8 Nov 2006, Ales Katona wrote: Jonas currently fpc2.1.1 doesn't compile on 2.1.1 with: rtl/units/i386-freebsd -di386 -dRELEASE ../unix/cthreads.pp cthreads.pp(252,42) Error: Incompatible type for arg no. 1: Got LongInt, expected Pointer Note: unixtypes thread_t = pointer

Re: [fpc-devel] CSuspendThread/CResumeThread

2006-11-08 Thread Marco van de Voort
Note: unixtypes thread_t = pointer Wrong, same as in ptypes.inc pthreads.inc thread_t (BSD and linux) = cInt {linux is Longint but that's just bug) freebsd/pthreads.inc doesn't define thread_t, neither does the linux version? There is a small issue with tthreadid which is already used to

Re: [fpc-devel] CSuspendThread/CResumeThread

2006-11-08 Thread Jonas Maebe
On 8 nov 2006, at 10:42, Ales Katona wrote: Jonas currently fpc2.1.1 doesn't compile on 2.1.1 with: rtl/units/i386-freebsd -di386 -dRELEASE ../unix/cthreads.pp cthreads.pp(252,42) Error: Incompatible type for arg no. 1: Got LongInt, expected Pointer So either TThreadID or pthread_t is

Re: [fpc-devel] CSuspendThread/CResumeThread

2006-11-08 Thread Ales Katona
A cleaner naming of problematic parts: 1. TThreadID is defined stand-alone not as a pthread_t, should be fixed. 2. TThreadHandler (the callback for resume, suspend) has result as DWord while posix stuff (pthread_kill etc.) usualy return cInt 3. in linux I saw pthreads functions return longint, I

Re: [fpc-devel] CSuspendThread/CResumeThread

2006-11-08 Thread Jonas Maebe
On 8 nov 2006, at 11:16, Ales Katona wrote: A cleaner naming of problematic parts: 1. TThreadID is defined stand-alone not as a pthread_t, should be fixed. 2. TThreadHandler (the callback for resume, suspend) has result as DWord while posix stuff (pthread_kill etc.) usualy return cInt 3.

Re: [fpc-devel] CSuspendThread/CResumeThread

2006-11-08 Thread Michael Van Canneyt
On Wed, 8 Nov 2006, Ales Katona wrote: A cleaner naming of problematic parts: 1. TThreadID is defined stand-alone not as a pthread_t, should be fixed. 2. TThreadHandler (the callback for resume, suspend) has result as DWord while posix stuff (pthread_kill etc.) usualy return cInt Just

Re: [fpc-devel] CSuspendThread/CResumeThread

2006-11-08 Thread Jonas Maebe
On 8 nov 2006, at 11:21, Jonas Maebe wrote: Question about #2. Well.. this is a tough nut? I suspect it's because of various threading backends, but we need to handle those -1 properly if nothing else but this implies going over by all used pthread functions and seeing all possible

Re: [fpc-devel] CSuspendThread/CResumeThread

2006-11-08 Thread Ales Katona
Just define an opaque type TThreadResult: TThreadResult = DWord // Windows TThreadResult = cInt // Unices I don't like this solution for several reasons: 1. What if one OS has more backends for threading available, which differ in this? 2. How are we going to handle error states on

Re: [fpc-devel] CSuspendThread/CResumeThread

2006-11-08 Thread Michael Van Canneyt
On Wed, 8 Nov 2006, Ales Katona wrote: Just define an opaque type TThreadResult: TThreadResult = DWord // Windows TThreadResult = cInt // Unices I don't like this solution for several reasons: 1. What if one OS has more backends for threading available, which differ in this?

[fpc-devel] CSuspendThread/CResumeThread

2006-11-07 Thread Jonas Maebe
Hello, Does anyone see a problem with the following CSuspendThread/ CResumeThread implementations? function CSuspendThread (threadHandle : TThreadID) : dword; begin result := pthread_kill(threadHandle,SIGSTOP); end; function CResumeThread (threadHandle : TThreadID) :

Re: [fpc-devel] CSuspendThread/CResumeThread

2006-11-07 Thread Ales Katona
On ut , 2006-11-07 at 18:39 +0100, Jonas Maebe wrote: Hello, Does anyone see a problem with the following CSuspendThread/ CResumeThread implementations? function CSuspendThread (threadHandle : TThreadID) : dword; begin result := pthread_kill(threadHandle,SIGSTOP);

Re: [fpc-devel] CSuspendThread/CResumeThread

2006-11-07 Thread Michael Van Canneyt
On Tue, 7 Nov 2006, Jonas Maebe wrote: Hello, Does anyone see a problem with the following CSuspendThread/CResumeThread implementations? function CSuspendThread (threadHandle : TThreadID) : dword; begin result := pthread_kill(threadHandle,SIGSTOP); end; function