celix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [celix] pnoltes commented on pull request #214: Fix data race in get/set bundle state
Date Mon, 04 May 2020 07:28:43 GMT

pnoltes commented on pull request #214:
URL: https://github.com/apache/celix/pull/214#issuecomment-623302918


   > Okay, testing it with clang shows that clang follows the spec more strictly. All c11
atomic functions should only be done on _Atomic specified variables. However, _Atomic is not
available in C++. There is a workaround, but you rely on the compiler to make it binary-compatible
(no guarantees between compiler versions)
   > 
   > ```
   > #ifdef __cplusplus
   > #include <atomic>
   > #define CELIX_ATOMIC(type) std::atomic<type>
   > #else
   > #include <stdatomic.h>
   > #define CELIX_ATOMIC(type) _Atomic type
   > #endif
   > ```
   > 
   > See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60932 for more info
   > 
   > I'm now against using C11 atomics and prefer my original approach, using the __atomic
builtins.
   
   I did not known it was this complicated. I agree use builtin types instead. 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message