Home » U++ Library support » U++ MT-multithreading and servers » Intentionally inconstistent use of "Atomic" in Mt.h?
Intentionally inconstistent use of "Atomic" in Mt.h? [message #14165] |
Sat, 16 February 2008 13:19 |
Werner
Messages: 234 Registered: May 2006 Location: Cologne / Germany
|
Experienced Member |
|
|
All the Atomic... functions in Mt.h (be it WIN32 or POSIX) return int - but shouldn't it be Atomic?
The type of Atomic depends:
MT & POSIX: _Atomic_word -> int
MT & WIN32: LONG -> long
ST & POSIX: int
ST & WIN32: int
Indeed the called WIN32 functions Interlocked... return long. So, to avoid implicit casts it might be preferable to adapt the return type of the Atomic... functions. If I then assign an Atomic to an int, I am seeing what I am doing.
Werner
|
|
|
Goto Forum:
Current Time: Tue May 21 19:59:57 CEST 2024
Total time taken to generate the page: 0.02308 seconds
|