projects
/
IRC.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dfffe4b
)
grabs a lock when it tries to reset
author
yeom
<yeom>
Wed, 17 Nov 2010 03:40:43 +0000
(
03:40
+0000)
committer
yeom
<yeom>
Wed, 17 Nov 2010 03:40:43 +0000
(
03:40
+0000)
Robust/src/Runtime/psemaphore.c
patch
|
blob
|
history
diff --git
a/Robust/src/Runtime/psemaphore.c
b/Robust/src/Runtime/psemaphore.c
index 64cdda50ca68bb49d53f8500c227580a241c17d5..05c7a1550967394e5a2f533363dc0ec5607a9a38 100644
(file)
--- a/
Robust/src/Runtime/psemaphore.c
+++ b/
Robust/src/Runtime/psemaphore.c
@@
-42,12
+42,8
@@
void psem_give_tag( psemaphore* sem, int tag) {
void psem_reset( psemaphore* sem ) {
- // this should NEVER BE CALLED if it is possible
- // the semaphore is still in use, NEVER
- if( pthread_mutex_trylock( &(sem->lock) ) == EBUSY ) {
- exit( -1 );
- }
- pthread_mutex_unlock( &(sem->lock) );
+ pthread_mutex_lock ( &(sem->lock) );
sem->tag++;
sem->signaled = 0;
+ pthread_mutex_unlock( &(sem->lock) );
}