aboutsummaryrefslogtreecommitdiff
path: root/src/common/threadpool.h
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2018-06-27 15:33:01 -0500
committerluigi1111 <luigi1111w@gmail.com>2018-06-27 15:33:01 -0500
commita844844cda9a0beb62d95015f92327366d73b3a1 (patch)
tree94f3bd7d54525a3f9262cc741078745e40b85cc5 /src/common/threadpool.h
parentMerge pull request #3977 (diff)
parentwallet2: cache ringdb key while refreshing (diff)
downloadmonero-a844844cda9a0beb62d95015f92327366d73b3a1.tar.xz
Merge pull request #3716
a2b557f 6795bd0 209ec96 ed2c81e a830db2 57ea902 31a895e ba8331c f7f1917 41be339 f025ae9 ef2cb63 dcfd299 5d3e702 2704624 2771a18 0e4c7d0 (moneromooo-monero)
Diffstat (limited to 'src/common/threadpool.h')
-rw-r--r--src/common/threadpool.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/common/threadpool.h b/src/common/threadpool.h
index bf80a87f6..a43e38a76 100644
--- a/src/common/threadpool.h
+++ b/src/common/threadpool.h
@@ -59,7 +59,7 @@ public:
public:
void inc();
void dec();
- void wait(); //! Wait for a set of tasks to finish.
+ void wait(threadpool *tpool); //! Wait for a set of tasks to finish.
waiter() : num(0){}
~waiter();
};
@@ -67,7 +67,7 @@ public:
// Submit a task to the pool. The waiter pointer may be
// NULL if the caller doesn't care to wait for the
// task to finish.
- void submit(waiter *waiter, std::function<void()> f);
+ void submit(waiter *waiter, std::function<void()> f, bool leaf = false);
unsigned int get_max_concurrency() const;
@@ -78,6 +78,7 @@ public:
typedef struct entry {
waiter *wo;
std::function<void()> f;
+ bool leaf;
} entry;
std::deque<entry> queue;
boost::condition_variable has_work;
@@ -86,7 +87,7 @@ public:
unsigned int active;
unsigned int max;
bool running;
- void run();
+ void run(bool flush = false);
};
}