summaryrefslogtreecommitdiff
path: root/lib/semtst.c
diff options
context:
space:
mode:
authorhorchi <vdr@jwendel.de>2017-03-05 16:39:28 +0100
committerhorchi <vdr@jwendel.de>2017-03-05 16:39:28 +0100
commite2a48d8701f91b8e24fbe9e99e91eb72a87bb749 (patch)
tree726f70554b4ca985a09ef6e30a7fdc8df089993c /lib/semtst.c
downloadvdr-epg-daemon-e2a48d8701f91b8e24fbe9e99e91eb72a87bb749.tar.gz
vdr-epg-daemon-e2a48d8701f91b8e24fbe9e99e91eb72a87bb749.tar.bz2
git init1.1.103
Diffstat (limited to 'lib/semtst.c')
-rw-r--r--lib/semtst.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/lib/semtst.c b/lib/semtst.c
new file mode 100644
index 0000000..68a784c
--- /dev/null
+++ b/lib/semtst.c
@@ -0,0 +1,42 @@
+
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#include "common.h"
+
+const char* logPrefix = "";
+
+int main()
+{
+
+ Sem s(0x3db00001);
+
+ if (s.check() == success)
+ printf("free \n");
+ else
+ printf("locked \n");
+
+ printf("inc\n");
+
+ s.inc();
+
+ printf("inc done\n");
+ sleep(5);
+
+ s.inc();
+
+ printf("inc done\n");
+ sleep(5);
+
+ s.v();
+ s.v();
+
+ if (s.check() == success)
+ printf("free \n");
+ else
+ printf("locked \n");
+
+ return 0;
+}