[fpc-pascal] Use sleep in thread

Marco van de Voort marcov at stack.nl
Thu Feb 26 14:53:51 CET 2015

In our previous episode, Xiangrong Fang said:
> BUT, that cannot be used to prioritize a thread. While you block a thread
> using rtlevent, it can only be unblocked from another thread. While you use
> sleep(), it still get time share of the CPU, only that it does nothing
> until sleep finishes, right?

No, basically a sleeping thread is marked in the scheduler as "do not schedule for nn
ticks". The thread doesn't run to evaluate if it should contiue. That is the
scheduler/kernel's task.

More information about the fpc-pascal mailing list