代码在tsk_runnable.h(c)中。
有一个tsk_runnable_t的结构体,如下:
typedef struct tsk_runnable_s
{
TSK_DECLARE_OBJECT;
const tsk_object_def_t *objdef;
tsk_thread_handle_t* h_thread[1];
tsk_runnable_func_run run;
tsk_thread_id_t id_thread; // no way to get this value from "h_thread" on WINXP
tsk_semaphore_handle_t *semaphore;
tsk_bool_t running;
tsk_bool_t started;
tsk_bool_t initialized;
/** whether the enqueued data are important or not.
* if yes, the thread will not be joined until all data in the queue have been consumed.
* default value: tsk_false
*/
tsk_bool_t important;
int32_t priority;
tsk_list_t *objects;
}
tsk_runnable_t;
可以看出,它是一个类,但这个类没有实例化过,全部是作为基类用的。可以理解为虚类(当然,这里面也没有这个概念&#x