Hi,

  I had a wrapper around fpc's Semaphore (psem_t), and implemented a Blocking Stack on top of it. I see my code does not work correctly for the following use case:

I have defined a ThreadPool that each of its thread gets a data and may Push some  data into the stack while the main thread pop from the stack and invoke a call to ThreadPool.

 I have tested my ThreadPool and Semaphore Wrapper implementation before and they seem to work correctly.  But the above code does not work properly. When the main process get suspended, it does not get resumed.

The Wiki <https://wiki.freepascal.org/Threads#Semaphores> says "the semaphore implementation in FPC's RTL was Posix-only, and has been deprecated, and removed as of FPC 3.2.0". So is that the reason why my code is not working properly or the reason is that the main process cannot be resumed?

Best,
Amir

P.S. At this point, my project is too big to share here! I can make a sample project with a similar logic if that helps.
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to