1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-15 00:24:19 +00:00

Fixed an issue terminating threads on iOS

This commit is contained in:
Tom Poole 2018-01-02 17:52:36 +00:00 committed by jules
parent 7c847e7126
commit 90f3d11ab8
2 changed files with 12 additions and 2 deletions

View file

@ -167,6 +167,11 @@ Thread* JUCE_CALLTYPE Thread::getCurrentThread()
return getCurrentThreadHolder()->value.get();
}
Thread::ThreadID Thread::getThreadId() const noexcept
{
return threadId.get();
}
//==============================================================================
void Thread::signalThreadShouldExit()
{
@ -174,6 +179,11 @@ void Thread::signalThreadShouldExit()
listeners.call ([] (Listener& l) { l.exitSignalSent(); });
}
bool Thread::threadShouldExit() const
{
return shouldExit.get() != 0;
}
bool Thread::currentThreadShouldExit()
{
if (auto* currentThread = getCurrentThread())

View file

@ -153,7 +153,7 @@ public:
@see signalThreadShouldExit, currentThreadShouldExit
*/
bool threadShouldExit() const { return shouldExit.get() != 0; }
bool threadShouldExit() const;
/** Checks whether the current thread has been told to stop running.
On the message thread, this will always return false, otherwise
@ -309,7 +309,7 @@ public:
thread's not actually running.
@see getCurrentThreadId
*/
ThreadID getThreadId() const noexcept { return threadId.get(); }
ThreadID getThreadId() const noexcept;
/** Returns the name of the thread.
This is the name that gets set in the constructor.