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]

Mutex assertion fail when select() timeout


Hi eCos folks,
    According to James Chen's early post, the following code will throw an
assertion on timed-out mutex in
kernel/current/src/sync/mutex.cxx.

=testing code=
#include<stdio.h>
#include<sys/select.h>
#include<sys/time.h>
int main(void)
{
        struct timeval tout;
        tout.tv_sec=0;
        tout.tv_usec=1;
        printf("Before select\n");
        select(0, NULL, NULL, NULL, &tout);
        printf("After select\n");
}

P.S.    The attached file is a patch suggested by Chen.

Happy hacking,
I-Jui Sung

mutex.cxx.patch


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