<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
Hi,<br>
<br>
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:<br>
<br>
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.<br>
<br>
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. <br>
<br>
The <a href="https://wiki.freepascal.org/Threads#Semaphores">Wiki</a>
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?<br>
<br>
Best,<br>
Amir<br>
<br>
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.<br>
</body>
</html>