Skip to content

Commit

Permalink
Hold the path lock no longer than necessary
Browse files Browse the repository at this point in the history
This will have a very minor effect, if any.
  • Loading branch information
garlick committed Feb 28, 2012
1 parent 48d4d62 commit c5c988a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions diod/ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,16 +421,14 @@ _path_decref (Npsrv *srv, Path path)
int n;

xpthread_mutex_lock (&pp->lock);

xpthread_mutex_lock (&path->lock);
n = --path->refcount;
xpthread_mutex_unlock (&path->lock);
if (n == 0) {
if (n == 0)
hash_remove (pp->hash, path->s);
_path_free (path);
}

xpthread_mutex_unlock (&pp->lock);
if (n == 0)
_path_free (path);
}

static Path
Expand Down

0 comments on commit c5c988a

Please sign in to comment.