ChimeraTK / cppext

A collection of C++ classes which are quite fundamental and thus considered inside ChimeraTK as an extension of C++.
GNU Lesser General Public License v3.0
2 stars 1 forks source link

Initialize std::atomic<when_any_notification_info> #17

Closed smarsching closed 1 year ago

smarsching commented 1 year ago

Before C++ 20, the default constructor of std::atomic does not initialize the underlying object (see https://en.cppreference.com/w/cpp/atomic/atomic/atomic). This can lead to situations where load() returns an uninitialized object, thus resulting in undefined behavior.

This PR fixes #16.