summaryrefslogtreecommitdiff
path: root/apps/examples/ostest/sem.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/examples/ostest/sem.c')
-rw-r--r--apps/examples/ostest/sem.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/apps/examples/ostest/sem.c b/apps/examples/ostest/sem.c
index 5c7f39cce..14d0c0725 100644
--- a/apps/examples/ostest/sem.c
+++ b/apps/examples/ostest/sem.c
@@ -33,18 +33,34 @@
*
***********************************************************************/
+/***********************************************************************
+ * Included Files
+ ***********************************************************************/
+
#include <stdio.h>
#include <pthread.h>
#include <semaphore.h>
#include <sched.h>
#include "ostest.h"
+/***********************************************************************
+ * Pre-processor Definitions
+ ***********************************************************************/
+
#ifndef NULL
# define NULL (void*)0
#endif
+/***********************************************************************
+ * Private Data
+ ***********************************************************************/
+
static sem_t sem;
+/***********************************************************************
+ * Private Functions
+ ***********************************************************************/
+
static void *waiter_func(void *parameter)
{
int id = (int)parameter;
@@ -138,6 +154,10 @@ static void *poster_func(void *parameter)
}
+/***********************************************************************
+ * Public Functions
+ ***********************************************************************/
+
void sem_test(void)
{
pthread_t waiter_thread1 = (pthread_t)0;