Skip to content

Commit

Permalink
Update Future.h
Browse files Browse the repository at this point in the history
Fixed a race condition caused by the double checked locking pattern by using an std::atomic that ensures correct and deterministic create and assignment logic.
  • Loading branch information
nfrmtkr authored Jan 8, 2024
1 parent 7efcd5f commit 30ab3c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ACE/ace/Future.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ class ACE_Future_Rep
int ready () const;

/// Pointer to the result.
T *value_;
std::atomic<T*> value_;

/// Reference count.
int ref_count_;
Expand Down

0 comments on commit 30ab3c0

Please sign in to comment.