FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/gpf/osl/os_sem_fl.c @ 444:caeff442faf1
os_sem_fl.c: os_ResetSemaphore() done
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Mon, 23 Jun 2014 01:10:51 +0000 |
parents | 42f9e12a9ced |
children | 9eeeef3ff7db |
comparison
equal
deleted
inserted
replaced
443:42f9e12a9ced | 444:caeff442faf1 |
---|---|
74 return(OS_ERROR); | 74 return(OS_ERROR); |
75 for (i = 1; i <= MaxSemaphores; i++) | 75 for (i = 1; i <= MaxSemaphores; i++) |
76 bzero(&SemTable[i], sizeof(T_OS_SEM_TABLE_ENTRY)); | 76 bzero(&SemTable[i], sizeof(T_OS_SEM_TABLE_ENTRY)); |
77 return(OS_OK); | 77 return(OS_OK); |
78 } | 78 } |
79 | |
80 GLOBAL LONG | |
81 os_ResetSemaphore(OS_HANDLE TaskHandle, OS_HANDLE SemHandle, | |
82 USHORT init_counter) | |
83 { | |
84 STATUS sts; | |
85 | |
86 sts = NU_Obtain_Semaphore(&SemSemCB, NU_SUSPEND); | |
87 if (!SemTable[SemHandle].Name[0]) { | |
88 error_out: if (sts == NU_SUCCESS) | |
89 NU_Release_Semaphore(&SemSemCB); | |
90 return(OS_ERROR); | |
91 } | |
92 if (NU_Reset_Semaphore(&SemTable[SemHandle].SemCB, init_counter) | |
93 != NU_SUCCESS) | |
94 goto error_out; | |
95 if (sts == NU_SUCCESS) | |
96 NU_Release_Semaphore(&SemSemCB); | |
97 return(OS_OK); | |
98 } |