From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Larmour To: Peter Graf Cc: ecos-discuss@sources.redhat.com Subject: Re: [ECOS] sscanf() vs. fgetc() Date: Thu, 12 Jul 2001 04:00:00 -0000 Message-id: <3B4D832C.370985AE@redhat.com> References: <3.0.5.32.20010712104805.00914420@128.128.128.220> X-SW-Source: 2001-07/msg00348.html Peter Graf wrote: > > Hi, > > after problems in a large context, I have cut things down to a short > example for a phenomenon I can't explain myself. > > I create and resume a new thread which uses fgetc() on a serial port, in an > infinite loop. > This new thread has a higher priority than the old one. > If no characters are received, fgetc blocks and the old thread continues. > > So far so good. > > But when I use sscanf() in the old thread, it hangs. Hmm.... cyg_thread_create()... cyg_thread_resume... fgetc()... fgetc() done. fgetc()... loop... sprintf... sscanf... sscanf done. loop... main() finished This was on a PC target FWIW. Perhaps you should step into sscanf() and see where it stops. Or if it gets stuck, press Ctrl-C and then "info threads", then switch to the main thread and do a backtrace. Jifl -- Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062 Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine Come to the Red Hat TechWorld open source conference in Brussels! Keynotes, techie talks and exhibitions http://www.redhat-techworld.com/