Browse Source

POSIX: Fix overflow when setting hi-res timer thread period on macOS/iOS

v6.1.6
ed 4 years ago
parent
commit
d9eb2022ed
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      modules/juce_core/native/juce_posix_SharedCode.h

+ 1
- 1
modules/juce_core/native/juce_posix_SharedCode.h View File

@@ -1368,7 +1368,7 @@ private:
mach_timebase_info (&timebase);
const auto ticksPerMs = ((double) timebase.denom * 1000000.0) / (double) timebase.numer;
const auto periodTicks = (uint32_t) (ticksPerMs * periodMs);
const auto periodTicks = (uint32_t) jmin ((double) std::numeric_limits<uint32_t>::max(), periodMs * ticksPerMs);
thread_time_constraint_policy_data_t policy;
policy.period = periodTicks;


Loading…
Cancel
Save