diff options
author | John Langford <jl@hunch.net> | 2010-12-06 20:32:15 +0300 |
---|---|---|
committer | John Langford <jl@hunch.net> | 2010-12-06 20:32:15 +0300 |
commit | f9b9c5a7ea154c9c4f5e842d69e539b8f2ebaf8f (patch) | |
tree | 2e6419d86d1f2d446e55a53af7aee9e427cd7ffc /parser.cc | |
parent | 7d5e04cbbd9e463e743e79a0cb529a29bb9ee6da (diff) |
fixed bugs Ariel found
Diffstat (limited to 'parser.cc')
-rw-r--r-- | parser.cc | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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) |