summaryrefslogtreecommitdiff
path: root/libiohelp/handle_io_release_conch.c
diff options
context:
space:
mode:
authorMarcus Brinkmann <marcus@gnu.org>2002-05-13 20:28:01 +0000
committerMarcus Brinkmann <marcus@gnu.org>2002-05-13 20:28:01 +0000
commiteae258051f8167114fdb82b7e6304a4b958a3cbb (patch)
tree1d20b4debe471e843910a906ecff843c4e29e6f4 /libiohelp/handle_io_release_conch.c
parent51fc4bf8fee0c8437b0fb269009ec3f4ed58ff99 (diff)
2002-05-11 Marcus Brinkmann <marcus@gnu.org>
* handle_io_release_conch.c (iohelp_handle_io_release_conch): New variable USER_SH. Hold USER_SH->lock while checking conch status.
Diffstat (limited to 'libiohelp/handle_io_release_conch.c')
-rw-r--r--libiohelp/handle_io_release_conch.c7
1 files changed, 5 insertions, 2 deletions
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;