mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-12-03 17:42:21 +00:00
Revert "ladspa: atomically get and set pending_deactivation"
This reverts commit 6c69b8ccff
.
This commit is contained in:
parent
7146ecd61b
commit
24614d343d
1 changed files with 4 additions and 4 deletions
|
@ -290,7 +290,7 @@ int fluid_ladspa_deactivate(fluid_ladspa_fx_t *fx)
|
||||||
|
|
||||||
/* Notify fluid_ladspa_run that we would like to deactivate and that it should
|
/* Notify fluid_ladspa_run that we would like to deactivate and that it should
|
||||||
* send us a signal when its done if it is currently running */
|
* send us a signal when its done if it is currently running */
|
||||||
fluid_atomic_int_set(&fx->pending_deactivation, 1);
|
fx->pending_deactivation = 1;
|
||||||
|
|
||||||
fluid_cond_mutex_lock(fx->run_finished_mutex);
|
fluid_cond_mutex_lock(fx->run_finished_mutex);
|
||||||
while (!fluid_atomic_int_compare_and_exchange(&fx->state, FLUID_LADSPA_ACTIVE, FLUID_LADSPA_INACTIVE))
|
while (!fluid_atomic_int_compare_and_exchange(&fx->state, FLUID_LADSPA_ACTIVE, FLUID_LADSPA_INACTIVE))
|
||||||
|
@ -305,7 +305,7 @@ int fluid_ladspa_deactivate(fluid_ladspa_fx_t *fx)
|
||||||
deactivate_plugin(fx->plugins[i]);
|
deactivate_plugin(fx->plugins[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
fluid_atomic_int_set(&fx->pending_deactivation, 0);
|
fx->pending_deactivation = 0;
|
||||||
|
|
||||||
LADSPA_API_RETURN(fx, FLUID_OK);
|
LADSPA_API_RETURN(fx, FLUID_OK);
|
||||||
}
|
}
|
||||||
|
@ -355,7 +355,7 @@ void fluid_ladspa_run(fluid_ladspa_fx_t *fx, fluid_real_t *left_buf[], fluid_rea
|
||||||
/* Somebody wants to deactivate the engine, so let's give them a chance to do that.
|
/* Somebody wants to deactivate the engine, so let's give them a chance to do that.
|
||||||
* And check that there is at least one plugin loaded, to avoid the overhead of the
|
* And check that there is at least one plugin loaded, to avoid the overhead of the
|
||||||
* atomic compare and exchange on an unconfigured LADSPA engine. */
|
* atomic compare and exchange on an unconfigured LADSPA engine. */
|
||||||
if (fluid_atomic_int_get(&fx->pending_deactivation) || fx->num_plugins == 0)
|
if (fx->pending_deactivation || fx->num_plugins == 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -405,7 +405,7 @@ void fluid_ladspa_run(fluid_ladspa_fx_t *fx, fluid_real_t *left_buf[], fluid_rea
|
||||||
|
|
||||||
/* If deactivation was requested while in running state, notify that we've finished now
|
/* If deactivation was requested while in running state, notify that we've finished now
|
||||||
* and deactivation can proceed */
|
* and deactivation can proceed */
|
||||||
if (fluid_atomic_int_get(&fx->pending_deactivation))
|
if (fx->pending_deactivation)
|
||||||
{
|
{
|
||||||
fluid_cond_mutex_lock(fx->run_finished_mutex);
|
fluid_cond_mutex_lock(fx->run_finished_mutex);
|
||||||
fluid_cond_broadcast(fx->run_finished_cond);
|
fluid_cond_broadcast(fx->run_finished_cond);
|
||||||
|
|
Loading…
Reference in a new issue