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]

Interrupt/Ctrl-C problem....


Hi,

I almost have a i386 eCos and RedBoot that works perfectly, except for a
tiny thing.

The problem can be reproduced with one of my test program joined her.

The program consist of a main thread and two other threads. Each thread
printf some string then do a cyg_thread_delay and loop forever.

I can interrupt the program with ctrl-C a first time, but then I have to
wait the next output to be able to ctrl-C again. But I don't really know if
this is the end of a delay or the diag_printf that allows me to interrupt
again.

If someone with other archs could test the following test program thank you.
If this work ok with other arch that would means there is problem left in my
i386 modifications.

/*====== hello.c =======*/
#include <cyg/kernel/kapi.h>

static char stack1[4096];
static char stack2[4096];
static cyg_thread t1;
static cyg_thread t2;

void thread1(void *arg)
{
	while(1){
		printf("1111_A thread1 here\n");
		cyg_thread_delay(777);
		printf("1111_B thread1 there\n");
		cyg_thread_delay(598);
		}	
}

void thread2(void *arg)
{
	while(1){
		printf("2222_A thread2 here\n");
		cyg_thread_delay(547);
		printf("2222_B thread2 there\n");
		cyg_thread_delay(958);
		}			
}

void main()
{ 
	cyg_handle_t h1,h2;

	printf("Hello, world\n");
	
	cyg_thread_create(10,&thread1,0,"thread1",&stack1,4096,&h1,&t1);
	cyg_thread_resume(h1);
	cyg_thread_create(10,&thread2,0,"thread2",&stack2,4096,&h2,&t2);
	cyg_thread_resume(h2);
	
	while(1)
	{
		printf("AA main thread here\n");
		cyg_thread_delay(333);
		printf("BB main thread there\n");
		cyg_thread_delay(1179);
	}
			
} //end main
/*=================*/

Thank You

-- 
Fabrice Gautier
fabrice_gautier@sdesigns.com 



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