summaryrefslogtreecommitdiff
path: root/src/main/portfolio.cpp
diff options
context:
space:
mode:
authorKshitij Bansal <kshitij@cs.nyu.edu>2012-10-19 19:10:42 +0000
committerKshitij Bansal <kshitij@cs.nyu.edu>2012-10-19 19:10:42 +0000
commit5796f9398adfab80860f17f4c99f143801689d56 (patch)
treea60b0a7a439de5386ea038cafc87470035c0c05e /src/main/portfolio.cpp
parent6f8d2ea6e8b6a8ff43352740131486bee6b2da27 (diff)
Fix problem with incremental with portfolio. Fixes bug 420.
(this commit was certified error- and warning-free by the test-and-commit script.)
Diffstat (limited to 'src/main/portfolio.cpp')
-rw-r--r--src/main/portfolio.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/portfolio.cpp b/src/main/portfolio.cpp
index 91037df17..4c542f548 100644
--- a/src/main/portfolio.cpp
+++ b/src/main/portfolio.cpp
@@ -29,8 +29,8 @@ boost::mutex mutex_done;
boost::mutex mutex_main_wait;
boost::condition condition_var_main_wait;
-bool global_flag_done = false;
-int global_winner = -1;
+bool global_flag_done;
+int global_winner;
template<typename S>
void runThread(int thread_id, boost::function<S()> threadFn, S& returnValue)
@@ -56,6 +56,9 @@ std::pair<int, S> runPortfolio(int numThreads,
boost::thread threads[numThreads];
S threads_returnValue[numThreads];
+ global_flag_done = false;
+ global_winner = -1;
+
for(int t = 0; t < numThreads; ++t) {
threads[t] =
boost::thread(boost::bind(runThread<S>, t, threadFns[t],
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback