Opened 9 years ago
Closed 9 years ago
#9632 closed Bugs (fixed)
public method start_thread in boost::thread class
Reported by: | Owned by: | viboes | |
---|---|---|---|
Milestone: | Boost 1.56.0 | Component: | thread |
Version: | Boost 1.53.0 | Severity: | Problem |
Keywords: | Cc: |
Description
There's a public method start_thread in the thread class. I couldn't find in the documentation what this method does.
In my code I accidentally called this method and it resulted in my callback being started twice.
Since calling the constructor implicitly starts the thread, I don't understand why such method should exist. I think that in one of the earlier versions of boost this was a private method. Is it possible that this method became public by mistake?
Change History (5)
comment:1 by , 9 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 9 years ago
This patch should solve the issue.
git diff ../include/boost/thread/detail/thread.hpp diff --git a/include/boost/thread/detail/thread.hpp b/include/boost/thread/detail/thread.hpp index 2434723..5053b8d 100644 --- a/include/boost/thread/detail/thread.hpp +++ b/include/boost/thread/detail/thread.hpp @@ -172,7 +172,7 @@ namespace boost private: bool start_thread_noexcept(); bool start_thread_noexcept(const attributes& attr); - public: + //public: void start_thread() { if (!start_thread_noexcept())
Please, could you confirm if you don't find any regression with it?
comment:3 by , 9 years ago
Milestone: | To Be Determined → Boost 1.56.0 |
---|
Committed in develop
https://github.com/boostorg/thread/commit/4a54ac033132791ee488b9ca1a323fee205a0026
comment:4 by , 9 years ago
This works for me (if I change just the .hpp file), but I didn't try compiling all of boost with this change. thanks!
comment:5 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Yes this is an error, it must be private. I will fix it.