Browse Source

Fixed an issue terminating threads on iOS

tags/2021-05-28
Tom Poole jules 7 years ago
parent
commit
90f3d11ab8
2 changed files with 12 additions and 2 deletions
  1. +10
    -0
      modules/juce_core/threads/juce_Thread.cpp
  2. +2
    -2
      modules/juce_core/threads/juce_Thread.h

+ 10
- 0
modules/juce_core/threads/juce_Thread.cpp 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())


+ 2
- 2
modules/juce_core/threads/juce_Thread.h 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.


Loading…
Cancel
Save