2 Copyright © 2015-2017, The AROS Development Team. All rights reserved.
8 #include <aros/debug.h>
9 #include <exec/types.h>
10 #include <aros/libcall.h>
11 #include <proto/utility.h>
12 #include <resources/task.h>
14 #include <resources/task.h>
16 #include "task_intern.h"
18 /*****************************************************************************
21 #include <proto/task.h>
23 AROS_LH2(void, UnLockTaskList
,
26 AROS_LHA(struct TaskList
*, tlist
, A0
),
27 AROS_LHA(ULONG
, flags
, D0
),
30 struct TaskResBase
*, TaskResBase
, 2, Task
)
33 Frees a lock on the task lists given by LockTaskList().
36 flags - the same value as given to LockTaskList().
47 LockTaskList(), NextTaskEntry()
51 *****************************************************************************/
56 struct TaskListPrivate
*taskList
, *tltmp
;
57 struct Task
*thisTask
= FindTask(NULL
);
58 #endif /* TASKRES_ENABLE */
60 D(bug("[TaskRes] UnLockTaskList: flags = $%lx\n", flags
));
63 ReleaseSemaphore(&TaskResBase
->trb_Sem
);
65 ForeachNodeSafe(&TaskResBase
->trb_LockedLists
, taskList
, tltmp
)
67 if (((struct Task
*)taskList
->tlp_Node
.ln_Name
== thisTask
) &&
68 (taskList
->tlp_Flags
== flags
))
70 D(bug("[TaskRes] UnLockTaskList: Releasing TaskList @ 0x%p\n", taskList
));
71 Remove(&taskList
->tlp_Node
);
72 FreeMem(taskList
, sizeof(struct TaskListPrivate
));
77 /* Purge expired entries from the list... */
78 task_CleanList(NULL
, TaskResBase
);
82 #endif /* TASKRES_ENABLE */
85 } /* UnLockTaskList */