[ECOS] ecos + lwip
Thu Aug 27 11:17:00 GMT 2009
Mandeep Sandhu wrote:
>> Threads that use lwip APIs (netcomm and sockets) *must* be created with
>> sys_new_thread(). Otherwise lwip's timeout mechanism will not work as
> Thanks for this info Simon.
> I'm stuck at how to pass an app supplied arg to my threads start function that's
> created using sys_thread_new().
> I want to pass an arg to my threads start function. I think the 2nd arg to
> sys_thread_new() seems to be user supplied arg, but from the usage I've seen
> that apps usually pass the thread's name to it in the 2nd arg.
> Internally, sys_thread_new uses this 2nd arg for both the name as well as the
> arg to the start function while calling cyg_thread_create(). So is there no way
> I can pass an arg to it (apart from the name)?
The implementation seems broken. I see three workarounds here:
1. Change the implementation to *not* use the user arg as the threads
name, but provide a dummy name to cyg_create_thread() instead.
2. Define a struct with the first field being a dummy name, followed by
any other fields you need and hand a pointer to this struct to
3. Use my new lwip port, which hopefully will soon be merged with eCos
CVS. In the new release, sys_thread_new() takes both a thread name and a
user argument, and uses them appropriately. Here is a preview release of
lwip 1.3.1 for eCos. Just copy all the files in the archive over the
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
More information about the Ecos-discuss