[PATCH] Fix run_events() to run all ready events instead of the first one in the list

boyang boyang at suse.de
Wed Mar 4 10:49:11 GMT 2009


Volker Lendecke wrote:
>
> No, this does not work. Event handlers can change the state
> of the other event handlers, in particular they can delete
> other event handlers. We had this, it leads to crashes.
>   
@vl:
      signal events and timer events will affect fd events, and fd
events can delete itself from the list in the handler. Does it make
sense to run all ready events of one kind instead of just one? Ie, if
there is signal events, we run them and return; else run timer events
and return....
     I have done some initial test, and it works fine for me.
     patch for this is in attachment. please review it.
     In fact, looks like the priority is signal events, timer events, fd
events, does it make sense to change the return value of run_events to
show what kind of events was run? If it returns SIGNAL_EVENT_RUN or
TIMER_EVENT_RUN, which indicates there might be more such events, we'd
better recall run_events() instead of jumping to select and then find
that there are pending signal events and timer events, which makes the
selected results useless for fd events, and we have to select again.
     If this makes sense, I'll change it.
> Sorry,
>
> Volker
>   

-------------- next part --------------
A non-text attachment was scrubbed...
Name: v1-fix-run_events-master.diff
Type: text/x-patch
Size: 2346 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20090304/e433e591/v1-fix-run_events-master.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: boyang.vcf
Type: text/x-vcard
Size: 187 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20090304/e433e591/boyang.vcf


More information about the samba-technical mailing list