mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
private: we only ever decrement activation with 1
This commit is contained in:
parent
0ee64c6fd3
commit
e86a770349
3 changed files with 4 additions and 4 deletions
|
|
@ -1737,7 +1737,7 @@ static inline void signal_sync(struct client *c)
|
|||
pw_log_trace_fp("%p: link %p %p %d/%d", c, l, state,
|
||||
state->pending, state->required);
|
||||
|
||||
if (pw_node_activation_state_dec(state, 1)) {
|
||||
if (pw_node_activation_state_dec(state)) {
|
||||
l->activation->status = PW_NODE_ACTIVATION_TRIGGERED;
|
||||
l->activation->signal_time = nsec;
|
||||
|
||||
|
|
|
|||
|
|
@ -1158,7 +1158,7 @@ static inline int trigger_targets(struct pw_impl_node *this, int status, uint64_
|
|||
pw_log_trace_fp("%p: (%s-%u) state:%p pending:%d/%d", t->node,
|
||||
t->name, t->id, state, state->pending, state->required);
|
||||
|
||||
if (pw_node_activation_state_dec(state, 1)) {
|
||||
if (pw_node_activation_state_dec(state)) {
|
||||
a->status = PW_NODE_ACTIVATION_TRIGGERED;
|
||||
a->signal_time = nsec;
|
||||
if (SPA_UNLIKELY(spa_system_eventfd_write(t->system, t->fd, 1) < 0))
|
||||
|
|
@ -1263,7 +1263,7 @@ int pw_impl_node_trigger(struct pw_impl_node *node)
|
|||
struct pw_node_activation *a = node->rt.target.activation;
|
||||
struct pw_node_activation_state *state = &a->state[0];
|
||||
|
||||
if (pw_node_activation_state_dec(state, 1)) {
|
||||
if (pw_node_activation_state_dec(state)) {
|
||||
uint64_t nsec = get_time_ns(node->data_system);
|
||||
a->status = PW_NODE_ACTIVATION_TRIGGERED;
|
||||
a->signal_time = nsec;
|
||||
|
|
|
|||
|
|
@ -549,7 +549,7 @@ static inline void pw_node_activation_state_reset(struct pw_node_activation_stat
|
|||
state->pending = state->required;
|
||||
}
|
||||
|
||||
#define pw_node_activation_state_dec(s,c) (__atomic_sub_fetch(&(s)->pending, c, __ATOMIC_SEQ_CST) == 0)
|
||||
#define pw_node_activation_state_dec(s) (ATOMIC_DEC(s->pending) == 0)
|
||||
|
||||
struct pw_node_target {
|
||||
struct spa_list link;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue