Torvald Riegel wrote: > What are the rwlock users, actually? A web search for gl_rwlock_t seems > to only turn up lock.h, but no users (unlike gl_lock_t, for example).
You're right, there are no users so far. But there may be in the future: Gnulib occasionally grabs some piece of code from glibc and makes it available on non-glibc systems. Many of the gnulib modules need to be multithread-safe. (For example, module 'fstrcmp' needs to be, because GNU gettext invokes it from within an OpenMP- parallelized region.) glibc uses an internal API <libc-lock.h> for its locking. It defines normal locks, rwlocks, recursive locks, and once-only control. Since this is what glibc code needs, in general, this is what the gnulib module 'lock' provides. And the test-lock.c code tests it, because it is good practice, in gnulib, to provide unit tests. Bruno