diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2019-12-04 17:52:12 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2019-12-04 17:52:12 +0000 |
commit | 437d93bdab427e99e024ad4c0d57c305d6f68f47 (patch) | |
tree | 4e084738dedc44ce37eb9c224a8c59963c2c6d8d /fastos | |
parent | 3abd363e0bf07f0467fb9f66815833330f68b223 (diff) |
Ensure that we have stopped the thread.
Diffstat (limited to 'fastos')
-rw-r--r-- | fastos/src/vespa/fastos/thread.cpp | 9 | ||||
-rw-r--r-- | fastos/src/vespa/fastos/thread.h | 15 |
2 files changed, 9 insertions, 15 deletions
diff --git a/fastos/src/vespa/fastos/thread.cpp b/fastos/src/vespa/fastos/thread.cpp index 3df8fa584a7..3e2f2674d97 100644 --- a/fastos/src/vespa/fastos/thread.cpp +++ b/fastos/src/vespa/fastos/thread.cpp @@ -352,17 +352,12 @@ void FastOS_ThreadInterface::Join () // FastOS_Runnable // ---------------------------------------------------------------------- -FastOS_Runnable::FastOS_Runnable(void) +FastOS_Runnable::FastOS_Runnable() : _thread(nullptr) { } -FastOS_Runnable::~FastOS_Runnable(void) +FastOS_Runnable::~FastOS_Runnable() { // assert(_thread == nullptr); } - -void FastOS_Runnable::Detach(void) -{ - _thread = nullptr; -} diff --git a/fastos/src/vespa/fastos/thread.h b/fastos/src/vespa/fastos/thread.h index c025a48d563..12866c71b2c 100644 --- a/fastos/src/vespa/fastos/thread.h +++ b/fastos/src/vespa/fastos/thread.h @@ -148,7 +148,7 @@ public: /** * Destructor. Closes pool if necessary. */ - virtual ~FastOS_ThreadPool(void); + virtual ~FastOS_ThreadPool(); /** @@ -168,9 +168,9 @@ public: * Get the stack size used for threads in this pool. * @return Stack size in bytes. */ - int GetStackSize(void) const { return _stackSize; } + int GetStackSize() const { return _stackSize; } - int GetStackGuardSize(void) const { return 0; } + int GetStackGuardSize() const { return 0; } /** * Close the threadpool. This involves setting the break flag on @@ -469,7 +469,7 @@ public: */ class FastOS_Runnable { -protected: +private: friend class FastOS_ThreadInterface; FastOS_ThreadInterface *_thread; @@ -498,10 +498,9 @@ public: */ virtual void Run(FastOS_ThreadInterface *thisThread, void *arguments)=0; - FastOS_ThreadInterface *GetThread(void) { return _thread; } - const FastOS_ThreadInterface *GetThread(void) const { return _thread; } - bool HasThread(void) const { return _thread != nullptr; } - void Detach(void); + FastOS_ThreadInterface *GetThread() { return _thread; } + const FastOS_ThreadInterface *GetThread() const { return _thread; } + bool HasThread() const { return _thread != nullptr; } }; #include <vespa/fastos/unix_thread.h> |