[fpc-pascal] TThread.Suspend under Linux

Graeme Geldenhuys graemeg.lists at gmail.com
Sat Jun 2 13:58:55 CEST 2007

On 6/2/07, Jonas Maebe <jonas.maebe at elis.ugent.be> wrote:
> > The GUI in frozen after that. Unresponsive, doesn't repaint, etc...  I
> > have to kill it with 'xkill' and click on the form.
> No, you can also type "fg" to let the process continue.

Ah, that worked yes...

> > But as soon as I
> > Suspend a thread, it returns me to the prompt!  Why???
> Because sending pthread_kill(SIGSTOP) to a particular thread
> apparently has to freeze the entire the process on posix-compliant
> systems, and not just the target thread. Early Linuxthreads
> implementations did not implement this properly and only stopped the
> targeted thread, but this has been fixed in NPTL.

After my post, I google'd some more and found a similar article
explaining the change in Linuxthreads.

> There is no portable way to suspend a thread at an arbitrary point
> under *nix, see
> http://pauillac.inria.fr/~xleroy/linuxthreads/faq.html#E

Okay that makes sense.  I guess my Thread Manager did actually teach
me something then.  :-)  Don't use .Suspend
I'll rework the Thread Manager example.  The Java link you sent came
in handle and it explains it very well and shows you what alternative
to use.

Thanks Jonas.


More information about the fpc-pascal mailing list