ComputationalRadiationPhysics / redGrapes

Resource-based, Declarative task-Graphs for Parallel, Event-driven Scheduling :grapes:
https://redgrapes.rtfd.io
Mozilla Public License 2.0
20 stars 5 forks source link

Dont pull alias shared_mutex into the std namespace #55

Closed ikbuibui closed 9 months ago

ikbuibui commented 9 months ago

RedGrapes was redefining shared_mutex as an alias of shared_timed_mutex in the std namespace, which was causing compile errors when used with alpaka. In general this extension of std is at best undefined behavior and shouldn't be done. This PR fixes this by explicitly calling std::shared_timed_mutex in redGrapes. Alternatively it is possible to do this alias in namespace redgrapes instead of pulling it into std, but especially with only a few places where std::shared_timed_mutex is used, this way seems more clear.

michaelsippel commented 9 months ago

std::shared_mutex is available from c++17 onwards. The alias was a workaround to get it in c++14 and can simply be removed when transisioning to c++17. I didnt want to write std::shared_timed_mutex since its not about timeouts, which the name implies but read/write-lock.

ikbuibui commented 9 months ago

std::shared_mutex is available from c++17 onwards. The alias was a workaround to get it in c++14 and can simply be removed when transisioning to c++17. I didnt want to write std::shared_timed_mutex since its not about timeouts, which the name implies but read/write-lock.

Noted. Thank you, I will update to use std::shared_mutex instead, along with a bump to c++17