On Tue, 23 Mar 2010 11:15:56 -0400 "Anurag S. Maskey" <Anurag.Maskey at Sun.COM> wrote:
> > > The other solution I can this of is to store the gettimeofday() when > > the script starts (in the object also). Then, if the object is > > re-read, this time is emptied out. When the script finishes running, > > the object is re-locked and the time on it can be checked to make sure > > that it hasn't been re-read. I think this would be a cleaner > > solution, rather than relying on ordering of function calls. Agreed. > > I reworked the fix to use gettimeofday(3C) rather than comparing the > address of the handles. Before the script is run, the time is stored in > the object. And this time in compared with after the script finishes. > If the ENM is (re)read, the script time is set to 0 in > nwamd_enm_handle_init_event(). > > webrev has been updated: > http://zhadum.east/export/ws/am223141/checkout-area/onnv-bug-6935812/webrev/ > > > enm.c:248-252,259-263,297 These similar lists of memory frees are hard > > to read and thus error prone. If you can organize them so they are all > > at end that would be great. > > > Accepted in webrev enm.c:225-227 What is wrong with gettimeofday(&object->nwamd_script_time, NULL) or object->nwamd_script_time = now? When you clean you might also think about setting to the time you clear instead of 0. OTOH if you always set to 0 when you clean then you only need to store seconds or some other free running (e.g. high resolution timers) timer. I kind of like storing the sec/usec on clear as that might have some debugging value. In any case those are nits. I like the solution. Do with those as you wish and push. Michael > > Thanks, > Anurag >
