From: Kern S. <ke...@si...> - 2003-10-29 08:55:45
|
Hello Nic, I see you have been busy. :-) It may take a couple of days to get back to you on this because I'm working on a very elusive bug. I look forward to examining and merging your code. Best regards, Kern PS: I recently wrote three new forms of making lists in Bacula. 1. alist.c (a simple malloc'ed array of pointers). 2. dlist.c (a doubly linked list), and 3. hlist,c which keeps the items in a hash table. The are all found in <bacula>/src/lib They are all written in C++ but don't in general use constructors and destructors, so coexist quite well with my C code. On Wed, 2003-10-29 at 01:16, Nic Bellamy wrote: > Hi Kern, > this is primarily directed at you, but I've CC'd -devel also in case it > interests anyone else. > > Some time ago when discussing my patch to make MaxStartDelay etc. work > as I wanted it to, we ended up agreeing I believe that instead of adding > yet another thread, the best way to do it would be to rework the > watchdog timers to be more generic, and hook it off that. > > I've now done this - patch attached, although it's not quite at a state > where I believe it should be applied - the primary question being > related to the new src/lib/bsd_queue.h file. > > How do you feel about the *BSD 'sys/queue.h' linked list macros? I'm > comfortable with them, so I've used them in this code, as they are far > clearer and more bug resistant than doing it manually. I can see many > places throughout Bacula that would benefit from their use - I have not, > however, included any such changes in this patch. > > I'm also pondering whether to add a destructor callback to the watchdog > structure, to enable "set and forget" watchdogs. There's a couple of > other little niggles marked out in the code with either FIXME or XXX. > > I've quite carefully tested the new watchdog code, and it has behaved > itself so far. I'm now just awaiting direction to get it to a point > where you'll merge it ;-) > > $ diffstat -p1 -w60 watchdog_rework_1.32c_20031029_cvs.diff > src/dird/dird.c | 2 > src/filed/filed.c | 2 > src/jcr.h | 1 > src/lib/Makefile.in | 4 > src/lib/bsd_queue.h | 549 ++++++++++++++++++++++++++++++++ > src/lib/jcr.c | 86 ++++- > src/lib/lib.h | 1 > src/lib/protos.h | 8 > src/lib/timers.c | 178 ++++++++++ > src/lib/timers.h | 37 ++ > src/lib/watchdog.c | 334 +++++++------------ > src/lib/watchdog.h | 24 - > src/stored/stored.c | 2 > 13 files changed, 1008 insertions(+), 220 deletions(-) > > Cheers, > Nic. |