summaryrefslogtreecommitdiffstats
path: root/lib/libc/regex/regex2.h
diff options
context:
space:
mode:
authordchagin <dchagin@FreeBSD.org>2009-05-01 15:36:02 +0000
committerdchagin <dchagin@FreeBSD.org>2009-05-01 15:36:02 +0000
commitdca50049ce746bdf7f10117a8dd8d72c8282585c (patch)
tree159658f59d3b4c2ce064cef433095d1cfa17a47c /lib/libc/regex/regex2.h
parent0c2462747fbc4d0912deb7c49d3336d1791ccbd4 (diff)
downloadFreeBSD-src-dca50049ce746bdf7f10117a8dd8d72c8282585c.zip
FreeBSD-src-dca50049ce746bdf7f10117a8dd8d72c8282585c.tar.gz
Reimplement futexes.
Old implemention used Giant to protect the kernel data structures, but at the same time called malloc(M_WAITOK), that could cause the calling thread to sleep and lost Giant protection. User-visible result was the missed wakeup. New implementation uses one sx lock per futex. The sx protects the futex structures and allows to sleep while copyin or copyout are performed. Unlike linux, we return EINVAL when FUTEX_CMP_REQUEUE operation is requested and either caller specified futexes are equial or second futex already exists. This is acceptable since the situation can only occur from the application error, and glibc falls back to old FUTEX_WAKE operation when FUTEX_CMP_REQUEUE returns an error. Approved by: kib (mentor) MFC after: 1 month
Diffstat (limited to 'lib/libc/regex/regex2.h')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud