On Thu, Sep 3, 2009 at 2:49 PM, Simon Kallweit<[email protected]> wrote: > Mandeep Sandhu wrote: >> >> On Thu, Sep 3, 2009 at 2:34 PM, Simon Kallweit<[email protected]> >> wrote: >>> >>> Mandeep Sandhu wrote: >>>> >>>> On Thu, Sep 3, 2009 at 2:22 PM, Simon Kallweit<[email protected]> >>>> wrote: >>>>> >>>>> Mandeep Sandhu wrote: >>>>> There is a semaphore created in cyg_lwip_sequential_init() which will >>>>> block >>>>> until all initialization (including ethernet devices) in the tcpip >>>>> thread >>>>> is >>>>> done. Therefore it's priority does not matter. >>>>> cyg_lwip_sequential_init() >>>>> should not return before initialization is completed. >>>>> >>>>> I just reviewed the code and found that the semaphore is initialized >>>>> with >>>>> 1, >>>>> which is clearly a bug, it should be initialized with 0 so that the >>>>> following call to cyg_semaphore_wait() is actually blocking the thread >>>>> until >>>>> initialization is done. >>>>> >>>>> My mistake, sorry! Hope it works as intended now. New release: >>>>> >>>>> http://download.westlicht.ch/lwip-20090903.tar.gz >>>> >>>> Thanks Simon. I totally missed the sem init part...i guess since the sem >>>> is >>>> init to 1...the thread never actually waits...and thats why I was seeing >>>> the >>>> problem. >>> >>> Exactly. I glanced over this code more than once and it didn't occur to >>> me. >>> Thanks a lot for testing! This is really helpful. >> >> No problem. I'm just glad I'm able to help. >> >> I downloaded your new rel. It still had that sem init'ed to 1! That should >> be >> 0 right? If thats the only change I'll do it in my local copy and test it. > > Oh my, git tricked me :) Yeah, this should be 0. Please see if that works. > It did for me, before git tricked me, hehe
Yup. It worked! Thanks Simon. Regards, -mandeep > > Simon > -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
