Skip to content

delete move ctor for ThreadPool (fixes #35) #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: RcppThread
Title: R-Friendly Threading in C++
Version: 0.5.3
Version: 0.5.4.9000
Authors@R:
person("Thomas", "Nagler", email = "mail@tnagler.com", role = c("aut", "cre"))
Description: Provides a C++11-style thread class and thread pool that can safely
Expand All @@ -12,7 +12,7 @@ LazyData: true
SystemRequirements: C++11
URL: https://github.com/tnagler/RcppThread
BugReports: https://github.com/tnagler/RcppThread/issues
RoxygenNote: 6.1.0
RoxygenNote: 6.1.1
Suggests:
testthat,
R.rsp,
Expand Down
6 changes: 3 additions & 3 deletions inst/include/RcppThread/ThreadPool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ThreadPool {
~ThreadPool() noexcept;

ThreadPool& operator=(const ThreadPool&) = delete;
ThreadPool& operator=(ThreadPool&& other) = default;
ThreadPool& operator=(ThreadPool&& other) = delete;

template<class F, class... Args>
void push(F&& f, Args&&... args);
Expand Down Expand Up @@ -69,7 +69,7 @@ class ThreadPool {
bool allJobsDone();
bool waitForWakeUpEvent();
void rethrowExceptions();

std::vector<std::thread> workers_; // worker threads in the pool
std::queue<std::function<void()>> jobs_; // the task que

Expand Down Expand Up @@ -382,7 +382,7 @@ inline bool ThreadPool::waitForWakeUpEvent()
}

//! rethrows exceptions (exceptions from workers are caught and stored; the
//! wait loop only checks, but does not throw for interruptions)
//! wait loop only checks, but does not throw for interruptions)
inline void ThreadPool::rethrowExceptions()
{
checkUserInterrupt();
Expand Down