This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cyg_thread_get_next function and list of eCos threads


Sorry for simple question. After looking to source code of eCos thread
I have found an answer to my question:

> 1) "all threads in eCos are stored in linked list"
> and
> 2) "in each new thread creation it is added to system's existing thread list".
> Are these two statements true?

Where both statements are true.

In eCos all extant thread are kept in single-linked list, while
private member of class Cyg_Thread->list_next points to the next
thread and last created thread's list_next points to the first item in
the list (hence making circle of single-linked list). Static member of
Cyg_Thread::thread_list always holds pointer to the last created
thread. (packages\kernel\current\include\thread.hxx)

Cyg_Thread::add_to_list() and Cyg_Thread::remove_from_list() methods
used to encapsulate thread_list and list_next member variables of
Cyg_Thread class.

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]