| 338 | } |
| 339 | |
| 340 | int pthread_mutex_lock(pthread_mutex_t *mutex) |
| 341 | { |
| 342 | const char *myname = "pthread_mutex_lock"; |
| 343 | |
| 344 | if (mutex == NULL) { |
| 345 | msg_error("%s, %s(%d): input invalid", |
| 346 | __FILE__, myname, __LINE__); |
| 347 | return -1; |
| 348 | } |
| 349 | |
| 350 | if (WaitForSingleObject(mutex->id, INFINITE) == WAIT_FAILED) { |
| 351 | msg_error("%s, %s(%d): WaitForSingleObject error(%s)", |
| 352 | __FILE__, myname, __LINE__, last_serror()); |
| 353 | return -1; |
| 354 | } |
| 355 | |
| 356 | return 0; |
| 357 | } |
| 358 | |
| 359 | int pthread_mutex_trylock(pthread_mutex_t *mutex) |
| 360 | { |
searching dependent graphs…