Fixing thread exit.

This commit is contained in:
Ben Vanik
2015-07-15 18:01:17 -07:00
parent 42400d06a9
commit 99104a25a8
3 changed files with 9 additions and 12 deletions

View File

@@ -310,6 +310,12 @@ class Thread : public WaitHandle {
static std::unique_ptr<Thread> Create(CreationParameters params,
std::function<void()> start_routine);
// Ends the calling thread.
// No destructors are called, and this function does not return.
// The state of the thread object becomes signaled, releasing any other
// threads that had been waiting for the thread to terminate.
static void Exit(int exit_code);
// Returns the current name of the thread, if previously specified.
std::string name() const { return name_; }
@@ -348,12 +354,6 @@ class Thread : public WaitHandle {
// Suspends the specified thread.
virtual bool Suspend(uint32_t* out_previous_suspend_count = nullptr) = 0;
// Ends the calling thread.
// No destructors are called, and this function does not return.
// The state of the thread object becomes signaled, releasing any other
// threads that had been waiting for the thread to terminate.
virtual void Exit(int exit_code) = 0;
// Terminates the thread.
// No destructors are called, and this function does not return.
// The state of the thread object becomes signaled, releasing any other