diff options
| author | Michael Bebenita <[email protected]> | 2010-07-19 14:05:18 -0700 |
|---|---|---|
| committer | Michael Bebenita <[email protected]> | 2010-07-19 14:05:18 -0700 |
| commit | 00d1465d13980fc3acf650f182ee0723fbda0e06 (patch) | |
| tree | a73cf5f0f20c0bee6722b33d975eb930919fefdf /src/rt/sync/condition_variable.h | |
| parent | Add a test for an obvious-seeming (but not actually legal) kind of cast attem... (diff) | |
| download | rust-00d1465d13980fc3acf650f182ee0723fbda0e06.tar.xz rust-00d1465d13980fc3acf650f182ee0723fbda0e06.zip | |
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.
Diffstat (limited to 'src/rt/sync/condition_variable.h')
| -rw-r--r-- | src/rt/sync/condition_variable.h | 19 |
1 files changed, 19 insertions, 0 deletions
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 */ |