Date: Sun, 30 Jan 2011 23:55:19 +0300 From: Chagin Dmitry <dchagin@freebsd.org> To: Alexander Best <arundel@freebsd.org> Cc: freebsd-emulation@freebsd.org Subject: Re: [patch] draft to add support for futex operators FUTEX_WAIT_BITSET and FUTEX_WAKE_BITSET to the linuxulator Message-ID: <20110130205519.GA44685@dchagin.static.corbina.ru> In-Reply-To: <20110129122617.GA77148@freebsd.org> References: <20110129122617.GA77148@freebsd.org>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] On Sat, Jan 29, 2011 at 12:26:17PM +0000, Alexander Best wrote: > hi there, > > i've spent a couple of hours hacking support for futex operators > FUTEX_WAIT_BITSET and FUTEX_WAKE_BITSET into the linuxulator. the following > patch is far from perfect and in certain places it is probably doing the wrong > thing, however it doesn't seem to break anything. > > i'd appreciate if somebody could have a look at the patch and point out any > issues. please note that the patch also contains a few unrelated comment > changes and such (however only very few). > > thanks in advance. > > the patch can be found in here: > > http://people.freebsd.org/~arundel/drafts/futex.diff > @@ -264,7 +265,7 @@ } static int -futex_wake(struct futex *f, int n) +futex_wake(struct futex *f, int n, int val3) { struct waiting_proc *wp, *wpt; int count = 0; @@ -275,6 +276,11 @@ f->f_uaddr, wp, f->f_refcount); wp->wp_flags |= FUTEX_WP_REMOVED; TAILQ_REMOVE(&f->f_waiting_proc, wp, wp_list); + + /* Unless we find a matching bit in */ + /* the bitmask, continue searching. */ + if (!(wp->wp_futex->f_bitmask & val3)) + continue; wakeup_one(wp); if (++count == n) break; @@ -325,13 +331,16 @@ probably error here, you should test bitset before removing wp from tailq. -- Have fun! chd [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (FreeBSD) iEYEARECAAYFAk1F0DcACgkQ0t2Tb3OO/O0SegCfZ6zqmgwMVCaRMl64m0Jc9ypC HNgAn1gyDFpH8Pif9OAByqW7TvtJ5928 =vFHv -----END PGP SIGNATURE-----help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110130205519.GA44685>
