added "itti_exit_task" to terminate current task when a MESSAGE_TERMINATE is received.

Modified "itti_wait_tasks_end" to exit when some threads are not terminated after a 1 second time-out.
modified "SIGINT" handling, exit is done after tring to join all threads like for "SIGUSR1".
Added message reception for TASK_L2L1 and handling of TEST and TERMINATE messages in oaisim.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4269 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
winckel
2013-10-23 14:08:42 +00:00
parent 6570f9ef69
commit f00c036367
4 changed files with 70 additions and 11 deletions
+26 -2
View File
@@ -376,14 +376,13 @@ void *l2l1_task(void *args_p) {
char fname[64], vname[64];
#if defined(ENABLE_ITTI)
MessageDef *message_p;
long timer_id;
itti_mark_task_ready(TASK_L2L1);
/* Test code */
{
MessageDef *message_p;
message_p = itti_alloc_new_message(TASK_L2L1, MESSAGE_TEST);
itti_send_msg_to_task(TASK_L2L1, INSTANCE_DEFAULT, message_p);
@@ -400,6 +399,31 @@ void *l2l1_task(void *args_p) {
#endif
for (frame = 0; frame < oai_emulation.info.n_frames; frame++) {
#if defined(ENABLE_ITTI)
// Checks if a message has been sent to L2L1 task
itti_poll_msg(TASK_L2L1, INSTANCE_ALL, &message_p);
if(message_p != NULL)
{
switch(message_p->header.messageId)
{
case TERMINATE_MESSAGE:
itti_exit_task();
break;
case MESSAGE_TEST:
LOG_D(EMU, "Received %s\n", itti_get_message_name(message_p->header.messageId));
break;
default:
LOG_E(EMU, "Received unexpected message %s\n", itti_get_message_name(message_p->header.messageId));
break;
}
free(message_p);
}
#endif
/*
// Handling the cooperation Flag
if (cooperation_flag == 2)