Is there a built-in semaphore structure that allows for waiting on more than one resource?
问题 I would like to be able wait/post more than one resource at a time. Is there a built-in c structure and interface that allows for this? Currently I am using semaphore.h however this interface has the limitation that it can only request a single resource at a time. I could do something like this: for (int i = 0; i < resources; i++) sem_wait(my_sem); But this would be time consuming if resources is large and I would also need to add another lock before this so that I am guaranteed that the