This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

assert: "no sleep slots"


hi,

in net/bsd_tcpip/current/src/ecos/synch.c

there are the following code lines:

 CYG_ASSERT( i <  CYGPKG_NET_NUM_WAKEUP_EVENTS, "no sleep slots" );
 
 // Defensive:
 if ( i >= CYGPKG_NET_NUM_WAKEUP_EVENTS ) {
     cyg_scheduler_unlock();
     return ETIMEDOUT;
 }

The things on this:

1) The if clause is redundant, because the assert will stop execution anyway.
2) I didn't try to figure out how this works, so my question:
   Is the assert there because, this must not happen (because of a
   bug/failure) or is it just here to say "no resources, please adjust
   your CDL parameters"?

So, would it be possible to remove the assert and let the if clause 
return ETIMEDOUT instead?

regards, Christoph
-- 

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]