Method code for $root.poll_semaphore()

[Turn off line numbering]
  1: arg type;
  2: var t;
  3: 
  4: if (!caller().has_flag('core))
  5:     return;
  6: while (1) {
  7:     if (!semaphores) {
  8:         semaphores = #[[type, task_id()]];
  9:         return;
 10:     }
 11:     if (type((| (t = semaphores[type]) |)) == 'error || !(t in tasks())) {
 12:         semaphores = dict_add(semaphores, type, task_id());
 13:         return;
 14:     }
 15:     pause();
 16:     pause();
 17:     pause();
 18: }
 19: 
 20: // $#Edited: 13 Nov 97 05:19 $miro

["// Created as a part of ColdCore, see: @help Credit"]

the Cold Dark