1
2007-05-20 Scott James Remnant <scott@netsplit.com>
3
* init/event.c (event_ref, event_unref): Reference counting of events
4
so we don't free those we still need.
5
(event_block, event_unblock): Blocker counting that replaces the
7
(event_new): Initialise refs and blockers fields.
8
(event_emit_finished): Remove this function.
9
(event_poll): Handle the new done state, and deal with the blockers
10
and references counts; turns out that we can fall all the way through
11
this switch if these are zero without needing to check again.
12
(event_pending): Remove call to event_emit_finished, the event_poll()
13
loop handles this case now.
14
(event_finished): Set progress to done on the way out.
15
* init/event.h (EventProgress): Add new done state
16
(Event): Add refs and blockers members, replacing jobs
17
* init/tests/test_event.c (test_new): Check refs and blockers are
19
(test_ref, test_unref, test_block, test_unblock): Check the ref
20
counting function behaviours.
21
(test_emit_finished): Drop this function since it's not used
22
* init/job.c (job_change_cause): Reference and block the event,
23
and unblock and unreference before changing.
24
(job_emit_event): Reference the event that blocks the job from
26
(job_handle_event_finished): Unreference the blocking event again.
27
(job_change_state): Make sure that blocked has been cleared before
28
allowing a state change.
29
* init/tests/test_job.c: Change tests to use refs/blockers on the
30
cause event when counting, and also to follow the status of blocked
31
since that is now ref-counted as well.
1
33
2007-05-18 Scott James Remnant <scott@netsplit.com>
3
35
* init/main.c (main, cad_handler, kbd_handler, pwr_handler): Use