This is the mail archive of the
ecos-devel@sources.redhat.com
mailing list for the eCos project.
cyg_io_read blocking
- From: Raghu <raghu_dk at yahoo dot com>
- To: ecos <ecos-devel at sources dot redhat dot com>
- Date: Fri, 8 Apr 2005 03:41:23 -0700 (PDT)
- Subject: cyg_io_read blocking
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=3Jn371y0poRZNYuYzvlrVB98HRYW0tt+jwbi5+06zQjhDmAnZFtT/sRP1h/faOEIC3/83d+sm5n1N4WlKD+Dl34aX6kP7YHWcxIerpyog+LZzNLKFr8b+4biBn3UIiW1DOirkrbLSSc6EvXqXezzjoN7UToXuwzNzQV4oMygjBY= ;
Hi,
Sample code of "cyg_io_read", "cyg_io_write" that
blocks when a thread is spawned, but if called from a
functions dosent.
void cyg_user_start( void )
{
cyg_thread_create( 4, serial_thread_handler, ...
);
cyg_thread_resume( handle );
}
void serial_thread_handler( cyg_addrword_t data )
{
cyg_io_lookup( &hdl );
for( ; ; ){
cyg_io_read( hdl, &ch, &len );
cyg_io_write( hdl, &ch, &len );
}
}
But if "serial_thread_handler" is directly called from
"cyg_user_start" as a function call, there is no
issues.
Regards,
Raghu.
__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo