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>2010-12-06 20:32:15 +0300
committerJohn Langford <jl@hunch.net>2010-12-06 20:32:15 +0300
commitf9b9c5a7ea154c9c4f5e842d69e539b8f2ebaf8f (patch)
tree2e6419d86d1f2d446e55a53af7aee9e427cd7ffc /parser.cc
parent7d5e04cbbd9e463e743e79a0cb529a29bb9ee6da (diff)
fixed bugs Ariel found
Diffstat (limited to 'parser.cc')
-rw-r--r--parser.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/parser.cc b/parser.cc
index c97c63a4..08625fe4 100644
--- a/parser.cc
+++ b/parser.cc
@@ -451,12 +451,13 @@ example* get_unused_example()
if (examples[parsed_index % ring_size].in_use == false)
{
examples[parsed_index % ring_size].in_use = true;
-
pthread_mutex_unlock(&examples_lock);
return examples + (parsed_index % ring_size);
}
else
- pthread_cond_wait(&example_unused, &examples_lock);
+ {
+ pthread_cond_wait(&example_unused, &examples_lock);
+ }
pthread_mutex_unlock(&examples_lock);
}
}
@@ -657,7 +658,7 @@ example* get_example(size_t thread_num)
cout << used_index[thread_num] << " " << parsed_index << " " << thread_num << " " << ring_index << endl;
assert((examples+ring_index)->in_use);
pthread_mutex_unlock(&examples_lock);
- return examples + ring_index;
+ return examples + ring_index;
}
else {
if (!done)