Re: [fpc-devel] Patch for RTLEvent calls which fixes a race condition

2006-12-18 Thread Lloyd Park
But my patch fixes the problem. In researching the problem I found a pthreads tutorial that said if you are using pthread_cond_wait() outside the body of an if statement, you are probably not using it properly. So my patch adds a boolean named IsSet to the intRTLEvent record. It is only set,

[fpc-devel] Patch for RTLEvent calls which fixes a race condition

2006-12-15 Thread Lloyd Park
I had problems with a threaded app under Linux which hung because one thread would sometimes call RTLSetEvent before the other called RTLEventStartWait. The attached patch for the 2.1.1 branch revision 5606 fixes the problem. Index: cthreads.pp

Re: [fpc-devel] Patch for RTLEvent calls which fixes a race condition

2006-12-15 Thread Micha Nelissen
Lloyd Park wrote: I had problems with a threaded app under Linux which hung because one thread would sometimes call RTLSetEvent before the other called RTLEventStartWait. The attached patch for the 2.1.1 branch revision 5606 fixes the problem. Better rewrite it to use semaphore (sem_*)