18 #include "wvwin32task.h" 23 #include "wvlinklist.h" 24 #include "wvstreamsdebugger.h" 25 #include "wvstringlist.h" 29 #define WVTASK_MAGIC 0x123678 45 typedef void TaskFunc(
void *userdata);
47 static int taskcount, numtasks, numrunning;
48 int magic_number, *stack_magic;
54 bool running, recycled;
58 ucontext_t func_call, func_return;
68 void start(
WvStringParm _name, TaskFunc *_func,
void *_userdata);
69 bool isrunning()
const 72 int get_tid()
const {
return tid; }
73 WvString get_name()
const {
return name; }
87 static int magic_number;
88 static WvTaskList all_tasks, free_tasks;
90 static void get_stack(
WvTask &task,
size_t size);
91 static void stackmaster();
92 static void _stackmaster();
93 static void do_task();
94 static void call_func(
WvTask *task);
96 static char *stacktop;
97 static ucontext_t stackmaster_task;
99 static WvTask *stack_target;
100 static ucontext_t get_stack_return;
102 static WvTask *current_task;
103 static ucontext_t toplevel;
108 #ifdef ENABLE_DELETE_DETECTOR 115 static void unlink();
118 WvTask::TaskFunc *func,
void *userdata,
119 size_t stacksize = 64*1024);
123 static int run(
WvTask &task,
int val = 1);
124 static int yield(
int val = 1);
127 {
return current_task; }
129 static const void *current_top_of_stack();
130 static size_t current_stacksize_limit();
134 WvStreamsDebugger::ResultCallback,
void *);
138 #endif // ifdef _WIN32 A WvFastString acts exactly like a WvString, but can take (const char *) strings without needing to a...
Represents a single thread of control.
This is a WvList of WvStrings, and is a really handy way to parse strings.
WvString is an implementation of a simple and efficient printable-string class.
Provides co-operative multitasking support among WvTask instances.