PERFORCE change 84453 for review
John Baldwin
jhb at FreeBSD.org
Wed Sep 28 13:25:15 PDT 2005
http://perforce.freebsd.org/chv.cgi?CH=84453
Change 84453 by jhb at jhb_slimer on 2005/09/28 20:25:08
Not a race. el_runcount already handles this.
Affected files ...
.. //depot/projects/smpng/sys/notes#60 edit
Differences ...
==== //depot/projects/smpng/sys/notes#60 (text+ko) ====
@@ -75,49 +75,6 @@
- arm, powerpc?
- fork counts?
- Add a cache-line padded mtx_aligned union and use it for the mutex pools.
-- Fix free race in eventhandlers:
-> In the macro "_EVENTHANDLER_INVOKE" in the file
-> "/sys/sys/eventhandler.h", you unlock the list lock
-> before calling the callback. That make sense. But what
-> happens if one process is in the callback, and another
-> process is deregistering this tag.
->
-> The solution is that the last thread
-> that has anything to do with a entry
-> frees it:
->
-> TAILQ_FOREACH()
-> {
-> refcount++;
->
-> EHL_UNLOCK();
->
-> callback();
->
-> EHL_LOCK();
->
-> refcount--;
->
-> if(refcount == 0)
-> free(entry);
-> }
->
-> At init:
-> refcount = 1;
->
->
-> At deregister:
->
-> EHL_LOCK();
->
-> refcount--;
-> if(refcount == 0)
-> free();
->
-> EHL_UNLOCK();
->
-> --HPS
->
Active child branches:
- jhb_intr - intr_event stuff
More information about the p4-projects
mailing list