1/// @brief LIFO-ordered task resource
3/// @defgroup taskresource_lifo LIFO
4/// @ingroup taskresource
7/// TRLifo provides strictly ordered LIFO (Last In, First Out) serialization of task execution.
8/// Tasks are guaranteed to run in reverse order of registration, with the most recent task
9/// running first (stack ordering).
11/// **Characteristics:**
12/// - Stack (LIFO) ordering
13/// - Most recently registered task runs first
14/// - Only one task runs at a time (serialized)
15/// - Efficient for moderate numbers of waiting tasks
18/// - Need stack-like processing order
19/// - Recent work should be prioritized over older work
20/// - Implementing cancellation hierarchies
21/// - Depth-first processing patterns
23/// **Example use case:**
24/// Resource cleanup where most recent allocations should be freed first.
26#include "taskresource.cxh"
27#include <cx/thread/mutex.h>
28#include <cx/taskqueue/task/complextask.cxh>
30/// @addtogroup taskresource_lifo
32/// Strictly ordered LIFO resource for stack-like task execution.
33class TRLifo extends TaskResource {
35 ComplexTask *cur; ///< Currently running task
36 sarray:object:ComplexTask _lifo; ///< Stack of waiting tasks
38 /// Create a new LIFO-ordered resource.
39 /// @return New TRLifo instance