| M E M _ D O S Y N C T A S K S ( )
| | | | | SOURCE: qdev_autodocs.txt 1.163 (12/09/2014) English AMIGA - MEM_#?
----------------------------------------------------------------------------
NAME
mem_dosynctasks() - Narrows task switching to selected
tasks.
SYNOPSIS
res = mem_dosynctask(tasks);
LONG mem_dosynctask(ULONG *);
FUNCTION
This function allows pseudo-exclusive interaction with
multiple tasks by manipulating their priorities, so it
it looks like 'Forbid()', but it is not!
INPUTS
tasks - Array of task addresses terminated with NULL.
Addresses are integers! Passing NULL causes
restore.
RETURNS
Returns 1 if synchronisation was attempted, 0 if it
is in progress.
BASES
SysBase
NOTES
This function is very helpful when there is a need to
detect when a group of tasks go to sleep.
Do not use this function if you know that task youre
trying to spy on never calls 'Wait()' or 'Signal()',
either directly or indirectly and/or does not die or
too dense signal(below 50 micros) is being delivered
from interrupts. Machine lockup guaranteed!
There is no way to tell whether 'Wait()' or 'Signal()'
were called. Task may loose CPU in both cases, but
in case of 'Signal()' it can only be detectable when
calling task signals task not in the 'tasks' table!
In order to stay in sync. you must call 'Forbid()' or
'Disable()'(preferred) as soon as possible. This must
be done right after calling this function ;-) . Then
do what you want, except for 'Wait()' ing(directly or
indirectly) and after that 'Permit()' or 'Enable()'.
Task presence wont be assured! If 'tasks' does not
correspond any tasks, this func. will return at once.
If this function is being used from concurrent tasks
then it will block for the period of synchronisation
in all other tasks, even in those who have advantage
of priority!
SEE ALSO
mem_dosynctask()
EXAMPLE
See 'testsuite/dosynctask-test.c' for more details.
BUGS
See 'mem_dosynctask()'.
----------------------------------------------------------------------------
| |
| |