thermferm/panel.c

changeset 199
3f5d277a69e3
parent 197
531725a09012
child 200
a215ddaabbe2
--- a/thermferm/panel.c	Sat Aug 09 17:06:25 2014 +0200
+++ b/thermferm/panel.c	Sat Aug 09 17:24:32 2014 +0200
@@ -26,6 +26,37 @@
 #ifdef HAVE_WIRINGPI_H
 
 
+extern int		my_shutdown;
+extern int		debug;
+
+
+
+PI_THREAD (my_panel_loop)
+{
+
+    syslog(LOG_NOTICE, "Thread my_panel_loop started");
+    if (debug)
+	fprintf(stdout, "Thread my_panel_loop started\n");
+
+    /*
+     * Loop forever until the external shutdown variable is set.
+     */
+    for (;;) {
+	if (my_shutdown)
+	    break;
+
+	/*
+	 * Loop 10 milliseconds
+	 */
+	usleep(10000);
+    }
+
+    syslog(LOG_NOTICE, "Thread my_panel_loop stopped");
+    if (debug)
+	fprintf(stdout, "Thread my_panel_loop stopped\n");
+
+    return 0;
+}
 
 
 #endif

mercurial