This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Mutex assertion fail when select() timeout
- To: <ecos-discuss at sources dot redhat dot com>
- Subject: [ECOS] Mutex assertion fail when select() timeout
- From: "I-Jui Sung" <ijsung at csie dot nctu dot edu dot tw>
- Date: Mon, 8 Oct 2001 21:35:21 +0800
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