2 Copyright © 1995-2015, The AROS Development Team. All rights reserved.
5 Desc: Forbid() - Prevent tasks switches from taking place.
9 #include <exec/types.h>
10 #include <exec/execbase.h>
11 #include <aros/libcall.h>
12 #include <aros/atomic.h>
14 #include "exec_intern.h"
21 /*****************************************************************************
25 #include <proto/exec.h>
27 AROS_LH0(void, Forbid
,
30 struct ExecBase
*, SysBase
, 22, Exec
)
33 Forbid any further taskswitches until a matching call to Permit().
34 Naturally disabling taskswitches means:
36 THIS CALL IS DANGEROUS
38 Do not use it without thinking very well about it or better
39 do not use it at all. Most of the time you can live without
40 it by using semaphores or similar.
42 Calls to Forbid() nest, i.e. for each call to Forbid() you
43 need one call to Permit().
49 The multitasking state will be disabled AFTER this function
50 returns to the caller.
53 This function preserves all registers.
55 To prevent deadlocks calling Wait() in forbidden state breaks
56 the forbid - thus taskswitches may happen again.
59 No you really don't want to use this function.
62 The only architecture that you can rely on the registers being
63 saved is on the Motorola mc68000 family.
66 Permit(), Disable(), Enable(), Wait()
69 If you want to preserve all the registers, replace this function
70 in your $(KERNEL) directory. Otherwise this function is
73 ******************************************************************************/
79 D(bug("[EXEC] Forbid()\n"));