通过观察:E:\LED显示\SourceInsight\mantis-2009-02-14-r2155\src\mos\kernel\linux下
typedef struct thread_s {
pthread_t pt;
pthread_cond_t blocker; //used to suspend/resume thread
pthread_mutex_t blockerMux; //protects blocker
void (*func)(void);
uint8_t state;
uint8_t priority;
struct thread_s *next;
} mos_thread_t;
和E:\LED显示\SourceInsight\mantis-2009-02-14-r2155\src\mos\kernel\micro下
typedef struct thread_s {
/** @brief Stack pointer */
stackval_t *sp; //线程当前的堆栈指针 stackval_t到底是什么类型,有些地方定义memtype_t,memtype_t又是什么类型?
/** @brief Pointer to stack memory for de-allocating */
stackval_t *stack; //堆栈基指针
/** @brief Size of stack (for debugging) */
uint16_t stackSize; //堆栈的大小
/** @brief Function pointer to thread's start func */
void (*func)(void); //指向线程开始函数的指针
/** @brief Thread sleep time */
uint32_t st; //线程的睡眠时间
/** @brief Current thread state */
uint8_t state; //目前线程的状态
/** @brief Current thread suspend state */
uint8_t suspend_state;//当前线程的挂起状态
/** @brief Thread priority */
uint8_t priority; //线程的优先级
/** @brief Port number -- Only used for net recv */
uint8_t port; //端口号(只用于网络接收)
/** @brief Next thread on list */
struct thread_s *next; //指向线程列表中的下一个线程
struct thread_s *waiting_for;
uint8_t thread_id;
} mos_thread_t;
应该是用的是:\mantis-2009-02-14-r2155\src\mos\kernel\micro目录的而不是E:\LED显示\SourceInsight\mantis-2009-02-14-r2155\src\mos\kernel\linux下的;
因为中科院的无线传感网络讲义中结构体是上面第二个;
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。