Beispiel #1
0
static void *calendar_manager_thread_entry(void *param)
{
  UNUSED(param);
  mqd_hdl mq;

  memset(input_buffer, '\0', MAX_MSG_QUEUE_SIZE+1);
  memset(answer_buffer, '\0', MAX_MSG_QUEUE_SIZE+1);

  if(FAILURE == QueueCreate(&mq, QUEUE_NAME, MAX_MSG_QUEUE_SIZE, MAX_MSG_QUEUE_NUM))
  {
    calendar_quit();
  }

  while(!calendar_exit)
  {
    if(FAILURE == QueueReceive(&mq, input_buffer, MODE_BLOCK))
    {
      calendar_quit();
    }

    CALENDER_DEBUG("Success to receive message : [ %s ] from user input process thread.", input_buffer);

    process_input_string(input_buffer, answer_buffer);

    if(FAILURE == QueueSend(&mq, answer_buffer, MODE_BLOCK))
    {
      calendar_quit();
    }

    CALENDER_DEBUG("Success to Answer message to user input process thread.");
    memset(answer_buffer, '\0', strlen(answer_buffer));
  }

  QueueDelete(&mq, QUEUE_NAME);
}
Beispiel #2
0
int main(int argc, char **argv){
	unsigned char data[16];
	int i;

	QueueOpen();

	printf("Main Start\n");

	QueueSend(MSGTYPE_DECODE, MSGTYPE_MAIN, 0xFF, 0x00, data);
	QueueSend(MSGTYPE_SLICE, MSGTYPE_MAIN, 0xFF, 0x00, data);
	QueueSend(MSGTYPE_RGB, MSGTYPE_MAIN, 0xFF, 0x00, data);
	QueueSend(MSGTYPE_PPM, MSGTYPE_MAIN, 0xFF, 0x00, data);

	for(i = 0; i < (IDCT_CORE); i++){
		QueueSend(MSGTYPE_IDCT + i, MSGTYPE_MAIN, 0xFF, 0x00, data);
	}

	return 0;
}