Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/vowpal_wabbit.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Langford <jl@hunch.net>2013-01-23 03:12:11 +0400
committerJohn Langford <jl@hunch.net>2013-01-23 03:12:11 +0400
commit8a12a18ab9eb08e45835de1d3eebfef0eedd0e23 (patch)
tree82ba0878f6c2f1fc8301fed9711b2e0ee7c94299 /vowpalwabbit/parse_primitives.h
parentd5695a55b2914c35c745f9406502b018a950d3f4 (diff)
deglobalized parser.cc locks
Diffstat (limited to 'vowpalwabbit/parse_primitives.h')
-rw-r--r--vowpalwabbit/parse_primitives.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/vowpalwabbit/parse_primitives.h b/vowpalwabbit/parse_primitives.h
index 3ca65db0..3054cc4e 100644
--- a/vowpalwabbit/parse_primitives.h
+++ b/vowpalwabbit/parse_primitives.h
@@ -13,6 +13,15 @@ license as described in the file LICENSE.
#include "io.h"
#include "example.h"
+#ifndef _WIN32
+typedef pthread_mutex_t MUTEX;
+typedef pthread_cond_t CV;
+#else
+#include <Windows.h>
+typedef CRITICAL_SECTION MUTEX;
+typedef CONDITION_VARIABLE CV;
+#endif
+
struct substring {
char *begin;
char *end;
@@ -76,6 +85,12 @@ struct parser {
uint64_t local_example_number;
example* examples;
uint64_t used_index;
+ MUTEX examples_lock;
+ CV example_available;
+ CV example_unused;
+ MUTEX output_lock;
+ CV output_done;
+
bool done;
v_array<size_t> gram_mask;