From eae258051f8167114fdb82b7e6304a4b958a3cbb Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Mon, 13 May 2002 20:28:01 +0000 Subject: 2002-05-11 Marcus Brinkmann * handle_io_release_conch.c (iohelp_handle_io_release_conch): New variable USER_SH. Hold USER_SH->lock while checking conch status. --- libiohelp/ChangeLog | 6 ++++++ libiohelp/handle_io_release_conch.c | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'libiohelp') diff --git a/libiohelp/ChangeLog b/libiohelp/ChangeLog index 34d8c817..8d34e7d8 100644 --- a/libiohelp/ChangeLog +++ b/libiohelp/ChangeLog @@ -1,3 +1,9 @@ +2002-05-11 Marcus Brinkmann + + * handle_io_release_conch.c (iohelp_handle_io_release_conch): + New variable USER_SH. Hold USER_SH->lock while checking conch + status. + 2002-05-07 Roland McGrath * iouser-reauth.c (iohelp_reauth): u_int -> size_t diff --git a/libiohelp/handle_io_release_conch.c b/libiohelp/handle_io_release_conch.c index fa95a6e5..8a6bd32d 100644 --- a/libiohelp/handle_io_release_conch.c +++ b/libiohelp/handle_io_release_conch.c @@ -23,13 +23,16 @@ void iohelp_handle_io_release_conch (struct conch *c, void *user) { - + struct shared_io *user_sh = c->holder_shared_page; + + spin_lock (&user_sh->lock); if (c->holder_shared_page->conch_status != USER_HAS_NOT_CONCH) { c->holder_shared_page->conch_status = USER_HAS_NOT_CONCH; iohelp_fetch_shared_data (c->holder); } - + spin_unlock (&user_sh->lock); + if (c->holder == user) { c->holder = 0; -- cgit v1.2.3