diff options
author | Dmitry Shmidt <dimitrysh@google.com> | 2009-09-01 16:17:25 -0700 |
---|---|---|
committer | Dmitry Shmidt <dimitrysh@google.com> | 2009-09-01 16:20:07 -0700 |
commit | d8f7ee5f20e2e0c651e6041c1d01c5beda4f4a99 (patch) | |
tree | 665c6df7da8b153aac64dc5a5ab793ee7d904553 /wilink_6_1/utils | |
parent | 6a0d0824f00909557486f113d52716238595aaa0 (diff) | |
download | ti-d8f7ee5f20e2e0c651e6041c1d01c5beda4f4a99.tar.gz |
Fix race conditions during removing items from the queue
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'wilink_6_1/utils')
-rw-r--r-- | wilink_6_1/utils/timer.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/wilink_6_1/utils/timer.c b/wilink_6_1/utils/timer.c index f0718a1..d3d10cd 100644 --- a/wilink_6_1/utils/timer.c +++ b/wilink_6_1/utils/timer.c @@ -180,14 +180,18 @@ void tmr_ClearInitQueue (TI_HANDLE hTimerModule) { TTimerModule *pTimerModule = (TTimerModule *)hTimerModule; + context_EnterCriticalSection (pTimerModule->hContext); while (que_Dequeue (pTimerModule->hInitQueue) != NULL) {} + context_LeaveCriticalSection (pTimerModule->hContext); } void tmr_ClearOperQueue (TI_HANDLE hTimerModule) { TTimerModule *pTimerModule = (TTimerModule *)hTimerModule; + context_EnterCriticalSection (pTimerModule->hContext); while (que_Dequeue (pTimerModule->hOperQueue) != NULL) {} + context_LeaveCriticalSection (pTimerModule->hContext); } @@ -594,4 +598,3 @@ void tmr_PrintTimer (TI_HANDLE hTimerInfo) #endif /* TI_DBG */ - |