diff options
author | Jakub Fornal <jakubfornal@gklab-20-101.igk.intel.com> | 2018-01-24 09:10:50 +0100 |
---|---|---|
committer | Jakub Fornal <jakubfornal@gklab-20-101.igk.intel.com> | 2018-01-24 09:10:50 +0100 |
commit | 722622cc9b91db51a4503fe990ce223fce77b8bb (patch) | |
tree | 7a996a0c4b7ae0759ec7d924d130da11ad5f56bd | |
parent | 4d877c29113a6ab6cde13589f77c7c017c84f697 (diff) | |
parent | 3f0aaff2866a6afa8b9387b75330ac95883f0fc3 (diff) | |
download | Open-AVB-722622cc9b91db51a4503fe990ce223fce77b8bb.tar.gz |
Merge branch 'new_dev_id_only' of https://github.com/jfornal/Open-AVB into new_dev_id_only
-rw-r--r-- | daemons/gptp/common/ether_port.cpp | 8 | ||||
-rw-r--r-- | daemons/gptp/linux/src/linux_hal_common.cpp | 20 |
2 files changed, 13 insertions, 15 deletions
diff --git a/daemons/gptp/common/ether_port.cpp b/daemons/gptp/common/ether_port.cpp index e576705c..56db3d22 100644 --- a/daemons/gptp/common/ether_port.cpp +++ b/daemons/gptp/common/ether_port.cpp @@ -174,14 +174,8 @@ void EtherPort::startPDelay() if( getPDelayInterval() != PTPMessageSignalling::sigMsgInterval_NoSend) { - long long unsigned int waitTime; - waitTime = ((long long) - (pow((double)2, - getPDelayInterval()) * - 1000000000.0)); - waitTime = waitTime > EVENT_TIMER_GRANULARITY ? waitTime : EVENT_TIMER_GRANULARITY; pdelay_started = true; - startPDelayIntervalTimer(waitTime); + startPDelayIntervalTimer(EVENT_TIMER_GRANULARITY); } } else { diff --git a/daemons/gptp/linux/src/linux_hal_common.cpp b/daemons/gptp/linux/src/linux_hal_common.cpp index 77bf664f..ab312c95 100644 --- a/daemons/gptp/linux/src/linux_hal_common.cpp +++ b/daemons/gptp/linux/src/linux_hal_common.cpp @@ -428,14 +428,19 @@ void *LinuxTimerQueueHandler( void *arg ) { timeout.tv_sec = 0; timeout.tv_nsec = 100000000; /* 100 ms */ sigemptyset( &waitfor ); - + GPTP_LOG_DEBUG("Signal thread started"); while( !timerq->stop ) { siginfo_t info; LinuxTimerQueueMap_t::iterator iter; sigaddset( &waitfor, SIGUSR1 ); if( sigtimedwait( &waitfor, &info, &timeout ) == -1 ) { - if( errno == EAGAIN ) continue; - else break; + if( errno == EAGAIN ) { + continue; + } + else { + GPTP_LOG_ERROR("Signal thread sigtimedwait error: %d", errno); + break; + } } if( timerq->lock->lock() != oslock_ok ) { break; @@ -456,7 +461,7 @@ void *LinuxTimerQueueHandler( void *arg ) { break; } } - + GPTP_LOG_DEBUG("Signal thread exit"); return NULL; } @@ -474,6 +479,9 @@ OSTimerQueue *LinuxTimerQueueFactory::createOSTimerQueue return NULL; } + ret->key = 0; + ret->stop = false; + ret->lock = clock->timerQLock(); if( pthread_create ( &(ret->_private->signal_thread), NULL, LinuxTimerQueueHandler, ret ) != 0 ) { @@ -481,10 +489,6 @@ OSTimerQueue *LinuxTimerQueueFactory::createOSTimerQueue return NULL; } - ret->stop = false; - ret->key = 0; - ret->lock = clock->timerQLock(); - return ret; } |