On 04/04/20(Sat) 22:30, Philip Guenther wrote: > [...] > glibc has internal inline functions futex_wait() and futex_wake() and > there has been at least discussion about exporting some version of them. > If our signatures matched the last-best-proposal over there (which was > dropped, mind you) then I would be tempted to use those names. If not, > then maybe go with _futex_wait() and _futex_wake()?
Do you know if those are similar to Mesa's function with the same names found in lib/mesa/src/util/futex.h ? Is the wait variant accepting relative or absolute timeout? Another way to proceed would be to do a port grep for futex and see what the ecosystem is using. > FUTEX_REQUEUE is the old bad one, with no val3 argument that's checked > before the operation. Our libc/libpthread don't actually use them, and in > the Linux world glibc switched completely to FUTEX_CMP_REQUEUE. Perhaps > we should drop support for FUTEX_REQUEUE (major bump, yah) and add > _futex_cmp_requeue(2) when we need it? > > [...] > > The prototypes I think I was imagining (*without* doing the checking > against glibc's proposal that I suggested, thus _futex* names) would be > something like: > > int _futex_wait(uint32_t *_futex, uint32_t _val, clockid_t _clock_id, > const struct timespec *_timeout, int _flags); > int _futex_wake(uint32_t *_futex, int _nr_wake, int _flags); > int _futex_cmp_requeue(uint32_t *_futex, int _nr_wake, int _nr_move, > uint32_t *_futex2, uint32_t _val, int _flags); Isn't wake redundant with cmp_requeue?