1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-11 23:54:18 +00:00
JUCE/modules
reuk c8dae58fd2
VST3 Host: Avoid calling processBlock, prepareToPlay, and releaseResources simultaneously
The old design had us checking isActive inside our audio callbacks, and
also modifying isActive from prepareToPlay(), and releaseResources(). To
avoid race conditions, and to ensure that isActive actually reflects the
activation state of our plugin, we need to lock in these places. If we
don't lock, there's a chance that other threads will observe isActive to
be true while the plugin is not actually active (for example).

If you're not convinced, imagine this scenario:
- The message thread calls prepareToPlay. The plugin is activated.
- The audio thread starts calling processBlock, and gets as far as the
  isActive check. The plugin appears active, so we continue into
  processBlock.
- At the same time, the message thread calls releaseResources(). The
  processBlock call is still in progress, but the message thread is
  simultaneously making calls to setProcessing() and setActive(), which
  is a race.

Normally, it'd be up to the host of the AudioProcessor to ensure that
prepareToPlay() isn't called at the same time as processBlock().
However, VST3 plugins can request a restart at any time from the UI
thread, requiring us to call prepareToPlay() even while processBlock()
is running.
2021-05-12 11:14:34 +01:00
..
juce_analytics Fixed a data race in ThreadedAnalyticsDestination 2021-03-25 18:24:11 +00:00
juce_audio_basics AudioPlayHead: Tidy up implementation 2021-05-06 15:51:09 +01:00
juce_audio_devices Removed some unnecessary angled brackets 2021-04-27 15:56:01 +01:00
juce_audio_formats Removed some unnecessary angled brackets 2021-04-27 15:56:01 +01:00
juce_audio_plugin_client VST3 Host: Ensure AudioProcessor parameter indices are used when appropriate 2021-05-06 16:04:22 +01:00
juce_audio_processors VST3 Host: Avoid calling processBlock, prepareToPlay, and releaseResources simultaneously 2021-05-12 11:14:34 +01:00
juce_audio_utils Fixed a documentation typo 2021-05-10 11:50:37 +01:00
juce_blocks_basics Fixed some compiler warnings 2021-04-16 16:44:05 +01:00
juce_box2d Bump version number to 6.0.8 2021-03-22 09:24:48 +00:00
juce_core Accessibility: Added VoiceOver (macOS) and Narrator (Windows) accessibility screen reader support to juce_gui_basics 2021-05-10 10:53:14 +01:00
juce_cryptography Bump version number to 6.0.8 2021-03-22 09:24:48 +00:00
juce_data_structures Added preliminary support for FreeBSD 2021-03-29 14:16:46 +01:00
juce_dsp DSP: Fix uses of "snap to zero" preprocessor definition 2021-04-12 10:57:19 +01:00
juce_events Removed some unnecessary virtual keywords 2021-04-27 15:56:01 +01:00
juce_graphics Accessibility: Added VoiceOver (macOS) and Narrator (Windows) accessibility screen reader support to juce_gui_basics 2021-05-10 10:53:14 +01:00
juce_gui_basics MinGW: Exclude native accessibility code 2021-05-12 08:02:20 +01:00
juce_gui_extra Accessibility: Added VoiceOver (macOS) and Narrator (Windows) accessibility screen reader support to juce_gui_basics 2021-05-10 10:53:14 +01:00
juce_opengl Added preliminary support for FreeBSD 2021-03-29 14:16:46 +01:00
juce_osc Bump version number to 6.0.8 2021-03-22 09:24:48 +00:00
juce_product_unlocking Used MemoryBlock::isEmpty() in a few places 2021-04-22 18:22:06 +01:00
juce_video Removed some unnecessary angled brackets 2021-04-27 15:56:01 +01:00
CMakeLists.txt Updated all license headers 2020-06-29 08:30:22 +01:00