Comparison of Linux and Ecos kernel thread creation/semaphore/event

Source: Internet
Author: User
Tags semaphore

Ecos

1 intGx_thread_create (Const Char*thread_name, gx_thread_id *thread_id,2         void(*entry_func) (void*),void*Arg,3         void*Stack_base,4UnsignedintStack_size,5UnsignedintPriority ,6Gx_thread_info *thread_info)7 {8 #defineGx_thread_priority_max 2559 Ten     if(Priority > Gx_thread_priority_max | | thread_id = =NULL One|| Entry_func = = NULL | | Thread_name = =NULL A|| Stack_base = = NULL | | Thread_info = =NULL) -         return-1;  -  theCYG_THREAD_CREATE_EX (cyg_addrword_t) Priority, (cyg_thread_entry_t *) Entry_func, (cyg_addrword_t) ARG, -(Char*) Thread_name, stack_base, (cyg_ucount32) stack_size, thread_id, Thread_info,0);  -  -Cyg_thread_resume (*thread_id); +  -     return 0; +}

Linux:

1 intGx_thread_create (Const Char*thread_name, gx_thread_id *thread_id,2         void(*entry_func) (void*),void*Arg,3         void*Stack_base,4UnsignedintStack_size,5UnsignedintPriority ,6Gx_thread_info *thread_info)7 {8     structTask_struct *task =NULL;9 TenTask = Kthread_create ((int(*) (void*)) Entry_func, ARG,"%s", thread_name); One     if(Task = =NULL) A         return-1;  -  -GXAV_DBG ("%s (), Task:%p\n", __func__,task); the  -*thread_id = (unsignedint) task; -  -GXAV_DBG ("%s (), thread_id:0x%x\n", __func__,*thread_id); +  - wake_up_process (Task); +  A     return 0; at}

Aa

Comparison of Linux and Ecos kernel thread creation/semaphore/event

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.