FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/gpf/osl/os_sem_fl.c @ 448:fd1729fd979e
os_sem_fl.c: os_DestroySemaphore() done
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Mon, 23 Jun 2014 02:13:02 +0000 |
parents | b55882290007 |
children | 03b6377d61db |
comparison
equal
deleted
inserted
replaced
447:b55882290007 | 448:fd1729fd979e |
---|---|
149 if (susp->sm_suspended_task == (NU_TASK *)tcb) | 149 if (susp->sm_suspended_task == (NU_TASK *)tcb) |
150 return(SemTable[i].SemCB.sm_name); | 150 return(SemTable[i].SemCB.sm_name); |
151 } | 151 } |
152 return(0); | 152 return(0); |
153 } | 153 } |
154 | |
155 GLOBAL LONG | |
156 os_DestroySemaphore(OS_HANDLE TaskHandle, OS_HANDLE SemHandle) | |
157 { | |
158 STATUS sts; | |
159 | |
160 sts = NU_Obtain_Semaphore(&SemSemCB, NU_SUSPEND); | |
161 if (!SemTable[SemHandle].Name[0]) { | |
162 error_out: if (sts == NU_SUCCESS) | |
163 NU_Release_Semaphore(&SemSemCB); | |
164 return(OS_ERROR); | |
165 } | |
166 if (NU_Delete_Semaphore(&SemTable[SemHandle].SemCB) != NU_SUCCESS) | |
167 goto error_out; | |
168 SemTable[SemHandle].Name[0] = 0; | |
169 if (sts == NU_SUCCESS) | |
170 NU_Release_Semaphore(&SemSemCB); | |
171 return(OS_OK); | |
172 } |