Skip to content

Commit

Permalink
pipewire: cmpxchng in_buffer + out_buffer to nullptr if they equal to…
Browse files Browse the repository at this point in the history
… buffer
  • Loading branch information
misyltoad committed Aug 29, 2024
1 parent 141782b commit d4ca0b9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/pipewire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,14 @@ static void destroy_buffer(struct pipewire_buffer *buffer) {
break; // nothing to do
default:
assert(false); // unreachable
}
}

// If out_buffer == buffer, then set it to nullptr.
// We don't care about the result.
struct pipewire_buffer *buffer1 = buffer;
out_buffer.compare_exchange_strong(buffer1, nullptr);
struct pipewire_buffer *buffer2 = buffer;
in_buffer.compare_exchange_strong(buffer2, nullptr);

delete buffer;
}
Expand Down

0 comments on commit d4ca0b9

Please sign in to comment.