Exemple #1
0
/**
 * Enter in realtime and start the CAN receiver loop
 * @param port
 */
void* unixtimer_canReceiveLoop(void* port)
{
    /*get signal*/
    //  if(signal(SIGTERM, canReceiveLoop_signal) == SIG_ERR) {
    //		perror("signal()");
    //}
    unixtimer_ReceiveLoop_task_proc((CAN_PORT)port);

    return NULL;
}
Exemple #2
0
/**
 * Enter in realtime and start the CAN receiver loop
 * @param port
 */
void* unixtimer_canReceiveLoop(void* port)
{
    /*get signal*/
  	//  if(signal(SIGTERM, canReceiveLoop_signal) == SIG_ERR) {
	//		perror("signal()");
	//}

    // Set the cancelation state for immediatly cancel the task
    int ret;

    ret = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);

    if (ret != 0)
        perror("Can't enable the cancelation of the receiving task");

    ret = pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);

    if (ret != 0)
        perror("Can't set the asynchronous cancel typ");

    unixtimer_ReceiveLoop_task_proc((CAN_PORT)port);

    return NULL;
}