svn commit: r209831 - stable/8/sys/kern
Andriy Gapon
avg at FreeBSD.org
Thu Jul 8 21:02:32 UTC 2010
Author: avg
Date: Thu Jul 8 21:02:31 2010
New Revision: 209831
URL: http://svn.freebsd.org/changeset/base/209831
Log:
MFC r209247: lock_profile_release_lock: do not compare unsigned with zero
Note: no MFC to stable/7
Modified:
stable/8/sys/kern/subr_lock.c
Directory Properties:
stable/8/sys/ (props changed)
stable/8/sys/amd64/include/xen/ (props changed)
stable/8/sys/cddl/contrib/opensolaris/ (props changed)
stable/8/sys/contrib/dev/acpica/ (props changed)
stable/8/sys/contrib/pf/ (props changed)
stable/8/sys/dev/xen/xenpci/ (props changed)
Modified: stable/8/sys/kern/subr_lock.c
==============================================================================
--- stable/8/sys/kern/subr_lock.c Thu Jul 8 20:57:37 2010 (r209830)
+++ stable/8/sys/kern/subr_lock.c Thu Jul 8 21:02:31 2010 (r209831)
@@ -600,7 +600,7 @@ lock_profile_release_lock(struct lock_ob
struct lock_profile_object *l;
struct lock_prof_type *type;
struct lock_prof *lp;
- u_int64_t holdtime;
+ u_int64_t curtime, holdtime;
struct lpohead *head;
int spin;
@@ -628,9 +628,11 @@ lock_profile_release_lock(struct lock_ob
lp = lock_profile_lookup(lo, spin, l->lpo_file, l->lpo_line);
if (lp == NULL)
goto release;
- holdtime = nanoseconds() - l->lpo_acqtime;
- if (holdtime < 0)
+ curtime = nanoseconds();
+ if (curtime < l->lpo_acqtime)
goto release;
+ holdtime = curtime - l->lpo_acqtime;
+
/*
* Record if the lock has been held longer now than ever
* before.
More information about the svn-src-all
mailing list