about summary refs log tree commit diff stats
path: root/072scheduler.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-08-26 13:27:57 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-08-26 13:27:57 -0700
commit029a3bdf53b523eded91a30177affdcace3bb2a1 (patch)
tree8984ca1073ee20950d74d091eca4fb07e04f321f /072scheduler.cc
parentad2604e893edbb3cde3d5e14cf4418acd3ef7d65 (diff)
downloadmu-029a3bdf53b523eded91a30177affdcace3bb2a1.tar.gz
3258
In the process of debugging the last couple of commits (though I no
longer remember exactly how) I noticed that 'wait-for-routine' only
waits until the target routine stops running for any reason, including
when it blocks on something. That's not the synchronization primitive we
want in production code, even if it's necessary for some scenarios like
'buffer-lines-blocks-until-newline'. So we rename the old 'wait-for-routine'
primitive to 'wait-for-routine-to-block', and create a new version of
'wait-for-routine' that say callers of 'start-writing' can safely use,
because it waits until a target routine actually completes (either
successfully or not).
Diffstat (limited to '072scheduler.cc')
-rw-r--r--072scheduler.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/072scheduler.cc b/072scheduler.cc
index 33b75a2a..9d99067c 100644
--- a/072scheduler.cc
+++ b/072scheduler.cc
@@ -59,6 +59,7 @@ void run(routine* rr) {
     assert(Current_routine);
     assert(Current_routine->state == RUNNING);
     trace(9990, "schedule") << current_routine_label() << end();
+//?     cerr << "schedule: " << current_routine_label() << '\n';
     run_current_routine(Scheduling_interval);
     // Scheduler State Transitions
     if (Current_routine->completed())