Semaphores
Posted: Mon Jun 13, 2011 11:23 am
Hi,
I'm banging my head against the wall because I can't get the binary semaphore to work. What I'm trying to do is the unlock a thread on receive of a shell command.
I tried to initialize a binary semaphore in the main(). Then, the tread is put on hold until the semaphore gets released. The semaphore is released in a shell's method.
Maybe I'm not looking where I should but I can't find any examples.
Can someone show me tell me how to initialize a binary semaphore and where ( in main() ?). Then how to perform the wait and release operation ?
Best regards,
David
I'm banging my head against the wall because I can't get the binary semaphore to work. What I'm trying to do is the unlock a thread on receive of a shell command.
I tried to initialize a binary semaphore in the main(). Then, the tread is put on hold until the semaphore gets released. The semaphore is released in a shell's method.
Maybe I'm not looking where I should but I can't find any examples.
Can someone show me tell me how to initialize a binary semaphore and where ( in main() ?). Then how to perform the wait and release operation ?
Best regards,
David