36 #include <visp3/core/vpConfig.h>
37 #include <visp3/core/vpException.h>
39 #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) && (defined(VISP_HAVE_PTHREAD) || (defined(_WIN32) && !defined(WINRT_8_0)))
41 #if defined(VISP_HAVE_PTHREAD)
51 #ifdef ENABLE_VISP_NAMESPACE
70 #if defined(VISP_HAVE_PTHREAD)
78 typedef LPTHREAD_START_ROUTINE Fn;
86 vpThread() : m_handle(), m_isCreated(false), m_isJoinable(false) { }
110 #if defined(VISP_HAVE_PTHREAD)
111 int err = pthread_create(&m_handle,
nullptr, fn, args);
115 #elif defined(_WIN32)
116 DWORD dwThreadIdArray;
117 m_handle = CreateThread(
nullptr,
134 #if defined(VISP_HAVE_PTHREAD)
135 #elif defined(_WIN32)
136 CloseHandle(m_handle);
153 #if defined(VISP_HAVE_PTHREAD)
154 pthread_join(m_handle,
nullptr);
155 #elif defined(_WIN32)
156 #if defined(WINRT_8_1)
157 WaitForSingleObjectEx(m_handle, INFINITE, FALSE);
159 WaitForSingleObject(m_handle, INFINITE);
162 m_isJoinable =
false;
188 #ifdef ENABLE_VISP_NAMESPACE
error that can be emitted by ViSP classes.
@ cannotUseConstructorError
constructor error
vpThread(vpThread::Fn fn, vpThread::Args args=nullptr)
bool m_isCreated
Indicates if the thread is created.
Handle m_handle
Thread handle.
void create(vpThread::Fn fn, vpThread::Args args=nullptr)
bool m_isJoinable
Indicates if the thread is joinable.