On Tue, Nov 24, 2015 at 04:48:35PM -0500, Chris Metcalf wrote:
>Unless you want to take a big diversion into atomics, I'd be temptedI agree that cmpxchg, test_and_set_bit, fetch_or... functions with loose
>to leave Peter's macro alone and just write it off as necessary evil
>to handle the fact that thread_info.flags is all kinds of different sizes
>and types on different platforms, and definitely never an atomic_t.
>Instead just create an inline function atomic_return_or(), or
>whatever name you prefer, that operates on an atomic_t, and use
>the atomic_t type for your structure field. It's clearly a win to mark
>the data types as being atomic to the extent we can do so, I think.
namespaces aren't the best layout.
But casting thread_info to atomic_t really worries me, I'm not sure the ending
result would be correct at all. I prefer to sacrify correctness over namespace
sanity:-)