Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous message
Werner is currently offline  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
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Distant file info
Next Topic: Checking socket connection after send.
Goto Forum:
  


Current Time: Sun Apr 28 18:34:56 CEST 2024

Total time taken to generate the page: 0.02535 seconds