changeset 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
files gsm-fw/gpf/osl/os_sem_fl.c
diffstat 1 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gsm-fw/gpf/osl/os_sem_fl.c	Mon Jun 23 01:55:31 2014 +0000
+++ b/gsm-fw/gpf/osl/os_sem_fl.c	Mon Jun 23 02:13:02 2014 +0000
@@ -151,3 +151,22 @@
 	}
 	return(0);
 }
+
+GLOBAL LONG
+os_DestroySemaphore(OS_HANDLE TaskHandle, OS_HANDLE SemHandle)
+{
+	STATUS sts;
+
+	sts = NU_Obtain_Semaphore(&SemSemCB, NU_SUSPEND);
+	if (!SemTable[SemHandle].Name[0]) {
+error_out:	if (sts == NU_SUCCESS)
+			NU_Release_Semaphore(&SemSemCB);
+		return(OS_ERROR);
+	}
+	if (NU_Delete_Semaphore(&SemTable[SemHandle].SemCB) != NU_SUCCESS)
+		goto error_out;
+	SemTable[SemHandle].Name[0] = 0;
+	if (sts == NU_SUCCESS)
+		NU_Release_Semaphore(&SemSemCB);
+	return(OS_OK);
+}