| 63 | } |
| 64 | |
| 65 | int WaitForEvent(event_emul *e) |
| 66 | { |
| 67 | if (SDL_LockMutex(e->mutex) <= -1) { |
| 68 | ErrSdl(); |
| 69 | } |
| 70 | int ret = SDL_CondWait(e->cond, e->mutex); |
| 71 | if (ret <= -1 || SDL_CondSignal(e->cond) <= -1 || SDL_UnlockMutex(e->mutex) <= -1) { |
| 72 | SDL_Log(SDL_GetError()); |
| 73 | return -1; |
| 74 | } |
| 75 | return ret; |
| 76 | } |
| 77 | |
| 78 | } |
no test coverage detected