From 00d1465d13980fc3acf650f182ee0723fbda0e06 Mon Sep 17 00:00:00 2001 From: Michael Bebenita Date: Mon, 19 Jul 2010 14:05:18 -0700 Subject: Added a message passing system based on lock free queues for inter-thread communication. Channels now buffer on the sending side, and no longer require blocking when sending. Lots of other refactoring and bug fixes. --- src/rt/sync/condition_variable.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/rt/sync/condition_variable.h (limited to 'src/rt/sync/condition_variable.h') diff --git a/src/rt/sync/condition_variable.h b/src/rt/sync/condition_variable.h new file mode 100644 index 00000000..f847ef99 --- /dev/null +++ b/src/rt/sync/condition_variable.h @@ -0,0 +1,19 @@ +#ifndef CONDITION_VARIABLE_H +#define CONDITION_VARIABLE_H + +class condition_variable { +#if defined(__WIN32__) + HANDLE _event; +#else + pthread_cond_t _cond; + pthread_mutex_t _mutex; +#endif +public: + condition_variable(); + virtual ~condition_variable(); + + void wait(); + void signal(); +}; + +#endif /* CONDITION_VARIABLE_H */ -- cgit v1.2.3