void USR1_handler(int signo)
{

    pthread_t id;

    id = pthread_self();
    printf("thread %u: caught signal %d (USR1)\n", (unsigned int) id, signo);

    my_resume();
}
Example #2
0
void USR2_handler(int signo) {

	pthread_t id;

	id = pthread_self();
	fprintf(logfile,"thread %u: caught signal %d (USR2)\n", (unsigned int) id, signo);

	msgcount = 0;

	my_resume();
}
Example #3
0
/// PROPUESTA EJERCICIO: por cada USR1 -> crear un cliente nuevo
void USR1_handler(int signo) {
    
	pthread_t id;
	
	id = pthread_self();
	fprintf(logfile,"thread %u: caught signal %d (USR1)\n", (unsigned int) id, signo);

	// Create a client
	// ....
	create_client(gbl_mbox, default_client_type, nr_msgs, nr_secs);
	
	my_resume();
}
void SIGINT_handler(int signo)
{

    pthread_t id;

    id = pthread_self();
    printf("thread %u: caught signal %d (SIGINT)\n", (unsigned int) id, signo);

    // Should exit from endless loop, since app is to finish
    finish_thread=1;
    my_resume();

    // Tell Main thread it must finish
    main_resume();
}