[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 02/13: libpager: fix potential deadlock
From: |
Samuel Thibault |
Subject: |
[hurd] 02/13: libpager: fix potential deadlock |
Date: |
Wed, 26 Mar 2014 12:12:14 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 59b6c01edcd7013a112aeaf9d0bc33a8d2a2b8f1
Author: Justus Winter <address@hidden>
Date: Wed Mar 19 12:09:23 2014 +0100
libpager: fix potential deadlock
This patch releases the interlock before doing an rpc call, analogous
to 901c61a1d25e7c8963e51012760a82730eda1910.
* libpager/pager-attr.c (pager_change_attributes): Release interlock
before calling memory_object_change_attributes, to let the callbacks
take it.
---
libpager/pager-attr.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/libpager/pager-attr.c b/libpager/pager-attr.c
index 47da12a..ad1560e 100644
--- a/libpager/pager-attr.c
+++ b/libpager/pager-attr.c
@@ -77,11 +77,14 @@ pager_change_attributes (struct pager *p,
}
}
+ pthread_mutex_unlock (&p->interlock);
memory_object_change_attributes (p->memobjcntl, may_cache, copy_strategy,
wait ? p->port.port_right : MACH_PORT_NULL);
if (wait)
{
+ pthread_mutex_lock (&p->interlock);
+
while (ar->attrs_pending)
pthread_cond_wait (&p->wakeup, &p->interlock);
@@ -92,7 +95,7 @@ pager_change_attributes (struct pager *p,
ar->next->prevp = ar->prevp;
free (ar);
}
+
+ pthread_mutex_unlock (&p->interlock);
}
-
- pthread_mutex_unlock (&p->interlock);
}
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 07/13: mach-defpager: fix local includes, (continued)
- [hurd] 07/13: mach-defpager: fix local includes, Samuel Thibault, 2014/03/26
- [hurd] 12/13: Handle fonts with multiple-of-8 bbox width, Samuel Thibault, 2014/03/26
- [hurd] 01/13: libpager: fix comment of pager_change_attributes, Samuel Thibault, 2014/03/26
- [hurd] 13/13: Merge remote-tracking branch 'upstream/master' into upstream, Samuel Thibault, 2014/03/26
- [hurd] 11/13: Fix setting LGE flag, Samuel Thibault, 2014/03/26
- [hurd] 09/13: Align VGA buffers, Samuel Thibault, 2014/03/26
- [hurd] 08/13: mach-defpager: replace the magic typecast with a hash table, Samuel Thibault, 2014/03/26
- [hurd] 03/13: isofs: also copy the terminating zero in read_symlink_hook, Samuel Thibault, 2014/03/26
- [hurd] 06/13: mach-defpager: fix receiver lookups, Samuel Thibault, 2014/03/26
- [hurd] 04/13: libdiskfs: fix string termination, Samuel Thibault, 2014/03/26
- [hurd] 02/13: libpager: fix potential deadlock,
Samuel Thibault <=