aboutsummaryrefslogtreecommitdiff
path: root/hidio.h
diff options
context:
space:
mode:
authorOlaf Matthes <olafmatt@users.sourceforge.net>2006-12-01 16:04:37 +0000
committerOlaf Matthes <olafmatt@users.sourceforge.net>2006-12-01 16:04:37 +0000
commit9fe82926e2b75526f6752d82baf7af792f31dbe5 (patch)
tree6157e154cc4e3ff7b6d6a7946ba0a96e335939d6 /hidio.h
parent0edc4d45b97b52aa8ac118a4e376d24976977247 (diff)
added threading for 'open' and 'close', needs more work but shows that open is a blocking function that takes ages to complete on first call
svn path=/trunk/externals/io/hidio/; revision=6561
Diffstat (limited to 'hidio.h')
-rw-r--r--hidio.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/hidio.h b/hidio.h
index 3a2a670..9461358 100644
--- a/hidio.h
+++ b/hidio.h
@@ -3,6 +3,7 @@
#include <stdio.h>
#include <sys/syslog.h>
+#include <pthread.h>
#ifdef __linux__
#include <linux/types.h>
@@ -34,7 +35,7 @@ typedef void t_clock;
#define HIDIO_MAJOR_VERSION 0
#define HIDIO_MINOR_VERSION 0
-/* static char *version = "$Revision: 1.2 $"; */
+/* static char *version = "$Revision: 1.3 $"; */
/*------------------------------------------------------------------------------
* GLOBAL DEFINES
@@ -53,6 +54,18 @@ typedef void t_clock;
#define MAX_EVENTS_PER_POLL 64
/*------------------------------------------------------------------------------
+ * THREADING RELATED DEFINES
+ */
+
+#define REQUEST_NOTHING 0
+#define REQUEST_OPEN 1
+#define REQUEST_READ 2
+#define REQUEST_SEND 3
+#define REQUEST_CLOSE 4
+#define REQUEST_QUIT 5
+
+
+/*------------------------------------------------------------------------------
* CLASS DEF
*/
typedef struct _hidio
@@ -73,6 +86,11 @@ typedef struct _hidio
t_clock *x_clock;
t_outlet *x_data_outlet;
t_outlet *x_status_outlet;
+ t_int x_requestcode;
+ pthread_mutex_t x_mutex;
+ pthread_cond_t x_requestcondition;
+ pthread_cond_t x_answercondition;
+ pthread_t x_thread;
} t_hidio;