Date: Thu, 23 Jul 2015 09:51:50 -0400 From: Brandon Allbery <allbery.b@gmail.com> To: deco33000@yandex.com Cc: freebsd-stable <freebsd-stable@freebsd.org> Subject: Re: struct timehands: th_generation field Message-ID: <CAKFCL4Up=cW0mue-XXhnw%2Bu6KfTTSv8T4xzMr4%2B2p=Y4CoJ=rQ@mail.gmail.com> In-Reply-To: <464641437658995@web16j.yandex.ru> References: <464641437658995@web16j.yandex.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jul 23, 2015 at 9:43 AM, <deco33000@yandex.com> wrote: > I am struggling on one field of a struct : > http://fxr.watson.org/fxr/source/kern/kern_tc.c?v=FREEBSD10#L63 > I would like to understand what th_generation means please. > Seems to me you get a clue from: ( http://fxr.watson.org/fxr/source/kern/kern_tc.c?v=FREEBSD10#L192) */*** * Functions for reading the time. We have to loop until we are sure that** * the timehands that we operated on was not updated under our feet. See** * the comment in <sys/time.h> for a description of these 12 functions.** */* > > #ifdef FFCLOCK > voidfbclock_binuptime <http://fxr.watson.org/fxr/ident?v=FREEBSD10;i=fbclock_binuptime>(struct bintime <http://fxr.watson.org/fxr/ident?v=FREEBSD10;i=bintime> *bt <http://fxr.watson.org/fxr/ident?v=FREEBSD10;i=bt>) > { > struct timehands <http://fxr.watson.org/fxr/ident?v=FREEBSD10;i=timehands> *th; > unsigned int gen <http://fxr.watson.org/fxr/ident?v=FREEBSD10;i=gen>; > > do { > th = timehands <http://fxr.watson.org/fxr/ident?v=FREEBSD10;i=timehands>; > gen <http://fxr.watson.org/fxr/ident?v=FREEBSD10;i=gen> = th->th_generation; > *bt <http://fxr.watson.org/fxr/ident?v=FREEBSD10;i=bt> = th->th_offset; > bintime_addx <http://fxr.watson.org/fxr/ident?v=FREEBSD10;i=bintime_addx>(bt <http://fxr.watson.org/fxr/ident?v=FREEBSD10;i=bt>, th->th_scale * tc_delta <http://fxr.watson.org/fxr/ident?v=FREEBSD10;i=tc_delta>(th)); > } while (gen <http://fxr.watson.org/fxr/ident?v=FREEBSD10;i=gen> == 0 || gen <http://fxr.watson.org/fxr/ident?v=FREEBSD10;i=gen> != th->th_generation); > } > > -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAKFCL4Up=cW0mue-XXhnw%2Bu6KfTTSv8T4xzMr4%2B2p=Y4CoJ=rQ>