private: we only ever decrement activation with 1

This commit is contained in:
Wim Taymans 2023-07-13 12:18:11 +02:00
parent 0ee64c6fd3
commit e86a770349
3 changed files with 4 additions and 4 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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;