Mercurial > dwindows
comparison mac/dw.m @ 1202:5c1a01c6384d
Think we need to check the posted state inside the mutex...
Also if it is already posted, we should return DW_ERROR_NONE.
This will need to be committed for Unix too.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Fri, 30 Sep 2011 04:00:38 +0000 |
parents | 196cd8a8e6a8 |
children | 5cb7e52f76c7 |
comparison
equal
deleted
inserted
replaced
1201:196cd8a8e6a8 | 1202:5c1a01c6384d |
---|---|
8571 int rc; | 8571 int rc; |
8572 | 8572 |
8573 if(!eve) | 8573 if(!eve) |
8574 return DW_ERROR_NON_INIT; | 8574 return DW_ERROR_NON_INIT; |
8575 | 8575 |
8576 pthread_mutex_lock (&(eve->mutex)); | |
8577 | |
8576 if(eve->posted) | 8578 if(eve->posted) |
8577 return DW_ERROR_GENERAL; | 8579 { |
8580 pthread_mutex_unlock (&(eve->mutex)); | |
8581 return DW_ERROR_NONE; | |
8582 } | |
8578 | 8583 |
8579 pthread_mutex_lock (&(eve->mutex)); | |
8580 if(timeout != -1) | 8584 if(timeout != -1) |
8581 { | 8585 { |
8582 struct timeval now; | 8586 struct timeval now; |
8583 struct timespec timeo; | 8587 struct timespec timeo; |
8584 | 8588 |