diff options
author | Gil Pitney <gil.pitney@linaro.org> | 2015-01-28 23:54:30 +0000 |
---|---|---|
committer | Gil Pitney <gil.pitney@linaro.org> | 2015-01-28 23:54:30 +0000 |
commit | 718a32c0db1f85ffc601c41765d471357f1fa332 (patch) | |
tree | 1484d01a7075cb376be4943bce33c359f70d4d9b | |
parent | 99f4c19d71ca84f0a37f8007c53f19830de18975 (diff) |
commandqueue: Removed redundant mutex locking in Event::addDependentEvent()llvm_3_6
The commandqueue sanity test (tests/test_commandqueue.cpp) was failing.
This was due to a lock being taken twice in a row from the same
thread, with a mutex type of PTHREAD_MUTEX_DEFAULT, where re-locking
produces undefined behaviour.
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
-rw-r--r-- | src/core/commandqueue.cpp | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/src/core/commandqueue.cpp b/src/core/commandqueue.cpp index d6a8f88..f721ff3 100644 --- a/src/core/commandqueue.cpp +++ b/src/core/commandqueue.cpp @@ -716,10 +716,8 @@ void Event::setStatus(Status status) bool Event::addDependentEvent(Event *event) const { - pthread_mutex_lock(const_cast<pthread_mutex_t *>(&p_state_mutex)); if (p_status == Event::Complete) { - pthread_mutex_unlock(const_cast<pthread_mutex_t *>(&p_state_mutex)); return false; } @@ -727,7 +725,6 @@ bool Event::addDependentEvent(Event *event) const Coal::Event *tmp_event = const_cast<Coal::Event *>(this); tmp_event->reference(); // retain this event - pthread_mutex_unlock(const_cast<pthread_mutex_t *>(&p_state_mutex)); return true; } |