public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Bug in timed message box get function ?
@ 2001-02-19 16:49 Alex Brown
  2001-02-20  9:31 ` Hugo Tyson
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Brown @ 2001-02-19 16:49 UTC (permalink / raw)
  To: ecos-discuss

I think I have found a bug in the timed mbox get function.

The symptom is that it only accurately times out the first time it is
called. Further calls will always return immediately.

The problem (from what I can see), is that the alarm routines used in
mboxt2.inl take absolute times yet they are always passed in a delay.

I made a small change to mbox.cxx that solved the problem for me:

New:

Cyg_Mbox::get( cyg_tick_count timeout )
{
    void * p;
    if ( ! m.get( p, Cyg_Clock::real_time_clock->current_value()+timeout ) )
        return NULL;
    return p;
}

Old:

Cyg_Mbox::get( cyg_tick_count timeout )
{
    void * p;
    if ( ! m.get( p, timeout ) )
        return NULL;
    return p;
}

Is this a bug ? or am I doing something wrong ?

Regards,

Alex Brown
agb@cea.com.au

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-02-20  9:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-19 16:49 [ECOS] Bug in timed message box get function ? Alex Brown
2001-02-20  9:31 ` Hugo Tyson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).