svn commit: r247419 - projects/calloutng/sys/kern
Alexander Motin
mav at FreeBSD.org
Wed Feb 27 20:54:46 UTC 2013
Author: mav
Date: Wed Feb 27 20:54:45 2013
New Revision: 247419
URL: http://svnweb.freebsd.org/changeset/base/247419
Log:
Close the hypothetical race when new callout inserted into the callwheel
bucket, that now executes its last callout in direct mode, and so dropped
the lock, caching NULL as the next callout pointer.
Modified:
projects/calloutng/sys/kern/kern_timeout.c
Modified: projects/calloutng/sys/kern/kern_timeout.c
==============================================================================
--- projects/calloutng/sys/kern/kern_timeout.c Wed Feb 27 20:20:21 2013 (r247418)
+++ projects/calloutng/sys/kern/kern_timeout.c Wed Feb 27 20:54:45 2013 (r247419)
@@ -489,7 +489,6 @@ next:
* Stop if we looked far enough into the future.
*/
} while (firstb <= lastb);
- cc->cc_exec_next_dir = NULL;
cc->cc_firstevent = last;
#ifndef NO_EVENTTIMERS
cpu_new_callout(curcpu, last, first);
@@ -555,6 +554,8 @@ callout_cc_add(struct callout *c, struct
c, (int)(c->c_precision >> 32),
(u_int)(c->c_precision & 0xffffffff));
TAILQ_INSERT_TAIL(&cc->cc_callwheel[bucket], c, c_links.tqe);
+ if (cc->cc_exec_next_dir == NULL)
+ cc->cc_exec_next_dir = c;
#ifndef NO_EVENTTIMERS
/*
* Inform the eventtimers(4) subsystem there's a new callout
More information about the svn-src-projects
mailing list