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

Prevent Thread::sleep waking up on POSIX systems when receiving signals

This commit is contained in:
attila 2025-04-10 09:12:48 +02:00 committed by Attila Szarvas
parent 08b82c796b
commit fbcd416a84

View file

@ -55,10 +55,7 @@ void CriticalSection::exit() const noexcept { pthread_mutex_unlock (&loc
//==============================================================================
void JUCE_CALLTYPE Thread::sleep (int millisecs)
{
struct timespec time;
time.tv_sec = millisecs / 1000;
time.tv_nsec = (millisecs % 1000) * 1000000;
nanosleep (&time, nullptr);
std::this_thread::sleep_for (std::chrono::milliseconds (millisecs));
}
void JUCE_CALLTYPE Process::terminate()