[ECOS] sscanf() vs. fgetc()
Jonathan Larmour
jlarmour@redhat.com
Thu Jul 12 04:00:00 GMT 2001
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/
More information about the Ecos-discuss
mailing list