Method code for $scheduler.block_task()

[Turn off line numbering]
  1: arg ident;
  2: var tasks;
  3: 
  4: // I want to be atomic!
  5: // Add the task_id to the queue of blocked tasks for this identifier.
  6: if (blocked_tasks.contains(ident))
  7:     tasks = blocked_tasks[ident] + [task_id()];
  8: else
  9:     tasks = [task_id()];
 10: blocked_tasks = blocked_tasks.add(ident, tasks);
 11: 
 12: // And go to sleep until we are woken.
 13: return (> suspend() <);

// Miroslav Silovic
// Created 05-Sep-1995 as a part of ColdCore, see: @help Credit

Tlon