Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Boolean WaitForMultipleObjects(int Count, void **Handle, boolean fWaitall, long
- msTimeOut)
- {
- mutex_cond_t mutex_cond[Count];
- for(i=0; i < Count; i++){
- initialize the mutex and condition variable
- Create a new mutex_cond object mutex_cond[i]
- Add the mutex_cond object to the list of the Handle[i]
- }
- for(i=0; i < Count; i++){
- Lock mutex_cond[i]->mutex
- while (! Handle[i]->is_signaled) {
- Wait until timeout on mutex_cond[i]->cond_var
- }
- UnLock mutex_cond[i]->mutex
- }
- for(i=0; i < Count; i++){
- Delete mutex_cond[i] from Handle List
- }
Add Comment
Please, Sign In to add comment