On 8/9/20 2:44 AM, Bruno Haible wrote:
To me, this variable '__libc_single_threaded' is not something that should
be visible in source code
- because it is so low-level,
- because only one platform has it.
True enough, but how about suggesting that people write something like the
following?
bool mt = gl_multithreaded ();
if (mt) gl_lock_lock (file_cleanup_list_lock);
...
if (mt) gl_lock_unlock (file_cleanup_list_lock);
This is nearly as concise as the IF_MT_DECL and IF_MT macros, allows for further
enhancements by builtin_expect etc., and avoids the macro hackery.