struct thread_struct_wrapper *lwip_system_threads = NULL; // a list of all threads created by lwIP
sys_thread_t sys_thread_new(char *name, void (* thread)(void *arg), void *arg, int stacksize, int prio) {
sys_thread_t newthread;
SYS_ARCH_DECL_PROTECT(old_val);
newthread = malloc(sizeof(struct thread_struct_wrapper)); // allocate the space for the thread wrapper
if (newthread==NULL) return NULL;
SYS_ARCH_PROTECT(old_val); // Need to protect this -- preemption here could be a problem!
newthread.next = lwip_system_threads;
lwip_system_threads = newthread;
SYS_ARCH_UNPROTECT(old_val);
newthread.timeouts = NULL; // initialize the linked list to NULL
my_system_os_create_thread_function(&newthread.thread,
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库LwIP Platform Developers Manual 中文翻译(19)在线全文阅读。
相关推荐: