summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSivaraj R2018-10-24 00:03:29 -0500
committerSivaraj R2018-10-24 00:03:29 -0500
commit9eadd55ca05ca6ff9f092b4b68adaeddcb2dbd13 (patch)
tree40dbb5c67174cb7cba4c5888c9650818ca8f766e
parent2088f8870e748041ebfad106ab4722ca7941be57 (diff)
parent4175362b3fcc3e98e6126ada3fc24827a7a073b7 (diff)
downloadosal-9eadd55ca05ca6ff9f092b4b68adaeddcb2dbd13.tar.gz
osal-9eadd55ca05ca6ff9f092b4b68adaeddcb2dbd13.tar.xz
osal-9eadd55ca05ca6ff9f092b4b68adaeddcb2dbd13.zip
Merge pull request #151 in PROCESSOR-SDK/osal from review-PRSDK-4917 to master
* commit '4175362b3fcc3e98e6126ada3fc24827a7a073b7': PRSDK-4917: eliminate infinite wait for SemaphoreP_NO_WAIT
-rw-r--r--src/nonos/SemaphoreP_nonos.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/nonos/SemaphoreP_nonos.c b/src/nonos/SemaphoreP_nonos.c
index 0e0e044..b03effa 100644
--- a/src/nonos/SemaphoreP_nonos.c
+++ b/src/nonos/SemaphoreP_nonos.c
@@ -217,14 +217,19 @@ SemaphoreP_Status SemaphoreP_pend(SemaphoreP_Handle handle, uint32_t timeout)
217 else 217 else
218 { 218 {
219 HwiP_restore(key); 219 HwiP_restore(key);
220 if (semTimeout) 220 if (semTimeout == SemaphoreP_NO_WAIT)
221 {
222 ret_val = (SemaphoreP_TIMEOUT);
223 break;
224 }
225 else if (semTimeout == SemaphoreP_WAIT_FOREVER)
226 {
227 /* Wait forever */
228 }
229 else /* Timed wait */
221 { 230 {
222 Osal_delay(1); 231 Osal_delay(1);
223 semTimeout--; 232 semTimeout--;
224 if (semTimeout == 0)
225 {
226 ret_val = (SemaphoreP_TIMEOUT);
227 }
228 } 233 }
229 } 234 }
230 } 235 }