mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-05-02 02:22:25 +02:00
Use proper atomic functions
This commit is contained in:
@@ -25,12 +25,12 @@ ImageAssembler::~ImageAssembler()
|
||||
|
||||
bool ImageAssembler::is_slot_free(const int bunch_id)
|
||||
{
|
||||
return buffer_status_[bunch_id % IA_N_SLOTS] > 0;
|
||||
return buffer_status_[bunch_id % IA_N_SLOTS].load() > 0;
|
||||
}
|
||||
|
||||
bool ImageAssembler::is_slot_full(const int bunch_id)
|
||||
{
|
||||
return buffer_status_[bunch_id % IA_N_SLOTS] == 0;
|
||||
return buffer_status_[bunch_id % IA_N_SLOTS].load() == 0;
|
||||
}
|
||||
|
||||
void ImageAssembler::process(
|
||||
@@ -72,12 +72,12 @@ void ImageAssembler::process(
|
||||
}
|
||||
}
|
||||
|
||||
buffer_status_[bunch_id]--;
|
||||
buffer_status_[bunch_id].fetch_sub(1);
|
||||
}
|
||||
|
||||
void ImageAssembler::free_slot(const int bunch_id)
|
||||
{
|
||||
buffer_status_[bunch_id % IA_N_SLOTS] = n_modules_;
|
||||
buffer_status_[bunch_id % IA_N_SLOTS].store(n_modules_);
|
||||
}
|
||||
|
||||
ImageMetadataBlock* ImageAssembler::get_metadata_buffer(const int slot_id)
|
||||
|
||||
Reference in New Issue
Block a user