diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2015-02-25 14:09:38 +0100 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2015-02-25 14:09:38 +0100 |
commit | 8c02a01bc617e99e1c6b7627676402bb276bac80 (patch) | |
tree | eee2cc85a18e9afe382ddf31fcf7624f794fc92b | |
parent | f619aba4543de6b9a4fe6fb63b6f1840ef509846 (diff) | |
download | astra-8c02a01bc617e99e1c6b7627676402bb276bac80.tar.gz astra-8c02a01bc617e99e1c6b7627676402bb276bac80.tar.bz2 astra-8c02a01bc617e99e1c6b7627676402bb276bac80.tar.xz astra-8c02a01bc617e99e1c6b7627676402bb276bac80.zip |
Remove CAsyncAlgorithm::timedJoin
It is currently unused, and its current implementation is not very portable.
-rw-r--r-- | build/linux/configure.ac | 26 | ||||
-rw-r--r-- | include/astra/AsyncAlgorithm.h | 4 | ||||
-rw-r--r-- | src/AsyncAlgorithm.cpp | 26 |
3 files changed, 0 insertions, 56 deletions
diff --git a/build/linux/configure.ac b/build/linux/configure.ac index cbf6016..24f0124 100644 --- a/build/linux/configure.ac +++ b/build/linux/configure.ac @@ -48,32 +48,6 @@ dnl Use iostream to check if the C++ compiler works AC_CHECK_HEADER(iostream, , AC_MSG_ERROR([No working c++ compiler found])) -# clock_gettime - -AC_MSG_CHECKING([for clock_gettime]) -AC_TRY_LINK([ -#include <ctime> -],[ -struct timespec t; clock_gettime(CLOCK_REALTIME, &t); -],astra_clock_gettime_ok=yes,astra_clock_gettime_ok=no) -AC_MSG_RESULT($astra_clock_gettime_ok) -if test x$astra_clock_gettime_ok = xno; then - AC_MSG_CHECKING([for clock_gettime in librt]) - LIBS="$LIBS -lrt" - AC_TRY_LINK([ - #include <ctime> - ],[ - struct timespec t; clock_gettime(CLOCK_REALTIME, &t); - ],astra_clock_gettime_ok=yes,astra_clock_gettime_ok=no) - AC_MSG_RESULT($astra_clock_gettime_ok) - if test x$astra_clock_gettime_ok = xno; then - AC_MSG_ERROR([No clock_gettime found]) - else - SAVED_LIBS="$SAVED_LIBS -lrt" - fi -fi - - # boost-unit-test-framework AC_MSG_CHECKING([for boost-unit-test-framework]) diff --git a/include/astra/AsyncAlgorithm.h b/include/astra/AsyncAlgorithm.h index 2d5d31e..36e2184 100644 --- a/include/astra/AsyncAlgorithm.h +++ b/include/astra/AsyncAlgorithm.h @@ -75,10 +75,6 @@ public: */ virtual void run(int _iNrIterations = 0); - /** Wait for thread to complete and delete thread. - */ - virtual void timedJoin(int _milliseconds); - /** Return pointer to the wrapped algorithm. */ CAlgorithm* getWrappedAlgorithm() { return m_pAlg; } diff --git a/src/AsyncAlgorithm.cpp b/src/AsyncAlgorithm.cpp index fcc4dcb..b265f59 100644 --- a/src/AsyncAlgorithm.cpp +++ b/src/AsyncAlgorithm.cpp @@ -160,32 +160,6 @@ void CAsyncAlgorithm::runWrapped(int _iNrIterations) m_bDone = true; } -void CAsyncAlgorithm::timedJoin(int _milliseconds) -{ -#ifndef USE_PTHREADS - if (m_pThread) { - boost::posix_time::milliseconds rel(_milliseconds); - bool res = m_pThread->timed_join(rel); - if (res) { - delete m_pThread; - m_pThread = 0; - m_bThreadStarted = false; - } - } -#else - if (m_bThreadStarted) { - struct timespec abstime; - clock_gettime(CLOCK_REALTIME, &abstime); - abstime.tv_sec += _milliseconds / 1000; - abstime.tv_nsec += (_milliseconds % 1000) * 1000000L; - int err = pthread_timedjoin_np(m_thread, 0, &abstime); - if (err == 0) { - m_bThreadStarted = false; - } - } -#endif -} - void CAsyncAlgorithm::signalAbort() { if (m_pAlg) |