[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 09/16: libfshelp/get-identity.c: Simplify checking weak reference
From: |
Samuel Thibault |
Subject: |
[hurd] 09/16: libfshelp/get-identity.c: Simplify checking weak references |
Date: |
Tue, 09 Jan 2018 01:35:29 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 6868c17b7def25beb69e7b685496e078340d8b12
Author: Samuel Thibault <address@hidden>
Date: Sat Jan 6 02:05:06 2018 +0100
libfshelp/get-identity.c: Simplify checking weak references
* libfshelp/get-identity.c (id_clean): Test whether i is still in the
hash table instead of counting weak references.
---
libfshelp/get-identity.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/libfshelp/get-identity.c b/libfshelp/get-identity.c
index 96de55a..ac1b4f0 100644
--- a/libfshelp/get-identity.c
+++ b/libfshelp/get-identity.c
@@ -69,14 +69,13 @@ static void
id_clean (void *cookie)
{
struct idspec *i = cookie;
- struct references result;
pthread_mutex_lock (&idlock);
- refcounts_references (&i->pi.refcounts, &result);
- if (result.hard == 0 && result.weak == 2)
+ if (refcounts_hard_references(&i->pi.refcounts) == 0
+ && i->id_hashloc != NULL)
{
- /* Nobody got a send right in between and we have the last weak reference
- in addition to our caller's, so we can remove from the hash. */
+ /* Nobody got a send right in between, we can remove i from the hash. */
hurd_ihash_locp_remove (&idhash, i->id_hashloc);
+ i->id_hashloc = NULL;
ports_port_deref_weak (&i->pi);
}
pthread_mutex_unlock (&idlock);
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] branch upstream updated (83fef6c -> 104f312), Samuel Thibault, 2018/01/08
- [hurd] 07/16: libfshelp/get-identity.c: Avoid spurious ihash removal, Samuel Thibault, 2018/01/08
- [hurd] 09/16: libfshelp/get-identity.c: Simplify checking weak references,
Samuel Thibault <=
- [hurd] 06/16: libfshelp/get-identity: Use 64bit hashing for inodes, Samuel Thibault, 2018/01/08
- [hurd] 08/16: libihash: Make sure we do not remove a locp several times, Samuel Thibault, 2018/01/08
- [hurd] 02/16: Record executable entry for PIE core dumps, Samuel Thibault, 2018/01/08
- [hurd] 04/16: libfshelp: Add weak reference for hash table reference, Samuel Thibault, 2018/01/08
- [hurd] 13/16: rpctrace: Pass prefixed_name to _hurd_exec_paths., Samuel Thibault, 2018/01/08
- [hurd] 05/16: libfshelp/get-identity.c: add FIXME, Samuel Thibault, 2018/01/08
- [hurd] 01/16: Reserve IDs for proc_set_exe and proc_get_exe, Samuel Thibault, 2018/01/08
- [hurd] 12/16: Use the new _hurd_exec_file_name function, Samuel Thibault, 2018/01/08
- [hurd] 16/16: Implement /proc/<pid>/exe, Samuel Thibault, 2018/01/08
- [hurd] 14/16: Fix exec_paths through fakeroot or chroot, Samuel Thibault, 2018/01/08