Using SysV semaphores in a UNIX OS it is possible to implement an algorithm in which a process waits until the value of a semaphore reaches the value 0 (see man semop for details). Now, everybody seems to say that it is better to use other synchronization APIs, and so my question is: how can I obtain the same behavior using pthreads, POSIX semaphores or other similar APIs? If it is not possible, should I be worried about using SysV semaphores?
EDIT: I'm referring to a multithreaded scenario, threads are created using pthreads.