summaryrefslogtreecommitdiff
path: root/wilink_6_1/utils
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2009-09-01 16:17:25 -0700
committerDmitry Shmidt <dimitrysh@google.com>2009-09-01 16:20:07 -0700
commitd8f7ee5f20e2e0c651e6041c1d01c5beda4f4a99 (patch)
tree665c6df7da8b153aac64dc5a5ab793ee7d904553 /wilink_6_1/utils
parent6a0d0824f00909557486f113d52716238595aaa0 (diff)
downloadti-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.c5
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 */
-