mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 13:15:39 -04:00
Merge pull request #1764 from jtramm/seq_cst_fix
Fix for SharedArray relaxed memory ordering problem
This commit is contained in:
commit
ef3a1642db
1 changed files with 2 additions and 2 deletions
|
|
@ -73,12 +73,12 @@ public:
|
|||
{
|
||||
// Atomically capture the index we want to write to
|
||||
int64_t idx;
|
||||
#pragma omp atomic capture
|
||||
#pragma omp atomic capture seq_cst
|
||||
idx = size_++;
|
||||
|
||||
// Check that we haven't written off the end of the array
|
||||
if (idx >= capacity_) {
|
||||
#pragma omp atomic write
|
||||
#pragma omp atomic write seq_cst
|
||||
size_ = capacity_;
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue