bareos: master fd3277fe

Author Committer Branch Timestamp Parent
Sebastian Sura Sebastian Sura master 2023-11-27 09:47 master ec1c7b19 Pending
Changeset copy-thread: fix data race

We need to ensure that the writer does not write into the block we are
currently reading. Currently we only distinguish between data thats
inside the queue (which can neither be written to nor read from) and
data thats outside the queue (which can _both_ be written to and read
from).
To fix this data race we split the data into three categories instead:
- The head of the queue (which can only be read from)
- The rest of the queue (which can neither be read from nor written
to)
- The data outside the queue (which can only be written to)
To accomplish this we split the normal dequeue() function into two
parts. The normal dequeue() becomes peek-like, only returning the
head element, and the new function FinishDeq() does the actual
dequeuing.
mod - core/src/vmware/vadp_dumper/cbuf.cc Diff File
mod - core/src/vmware/vadp_dumper/cbuf.h Diff File
mod - core/src/vmware/vadp_dumper/copy_thread.cc Diff File