Our atomic ops library supports compilation in the mode where "atomic operations" aren't really atomic, but are protected with "rwlocks" (actually, mutexes). It was supposed to be used on platforms where we don't have native support for atomic ops.
This mode complicates the code significantly. There's a lot of extra declarations, preprocessor macros and wrappers, etc everywhere. But in fact, this mode is almost never used — in a few cases where it was used, that happened by mistake, was caused by an error elsewhere. Furthermore, XtraDB now has (and had it for quite a while) the code that requires atomic ops and cannot be compiled with rwlocks. We build with XtraDB everywhere — meaning atomic ops are supported everywhere where we build.
A suggestion is to remove this "rwlock" mode and remove all that complications that it forced into the code.