changeset 445:9eeeef3ff7db

os_sem_fl.c: os_QuerySemaphore() done
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 23 Jun 2014 01:19:50 +0000
parents caeff442faf1
children 57f8e2b747c4
files gsm-fw/gpf/osl/os_sem_fl.c
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gsm-fw/gpf/osl/os_sem_fl.c	Mon Jun 23 01:10:51 2014 +0000
+++ b/gsm-fw/gpf/osl/os_sem_fl.c	Mon Jun 23 01:19:50 2014 +0000
@@ -96,3 +96,19 @@
 		NU_Release_Semaphore(&SemSemCB);
 	return(OS_OK);
 }
+
+GLOBAL LONG
+os_QuerySemaphore(OS_HANDLE TaskHandle, OS_HANDLE SemHandle, USHORT *Count)
+{
+	OPTION SuspendType;
+	UNSIGNED SemCount, TasksWaiting;
+	NU_TASK *First;
+	CHAR Name[NU_MAX_NAME];
+
+	if (NU_Semaphore_Information(&SemTable[SemHandle].SemCB, Name,
+				     &SemCount, &SuspendType, &TasksWaiting,
+				     &First) != NU_SUCCESS)
+		return(OS_ERROR);
+	*Count = SemCount;
+	return(OS_OK);
+}