49 #include <visp3/core/vpMutex.h> 50 #include <visp3/core/vpThread.h> 52 #if defined(VISP_HAVE_PTHREAD) || (defined(_WIN32) && !defined(WINRT_8_0)) 54 int thread_counter = 0;
60 unsigned int thread_id = *((
unsigned int *)args);
62 std::cout <<
"Started job " << thread_counter <<
" with id " << thread_id << std::endl;
64 for (
unsigned long i = 0; i < (0xFFFF); i++) {
67 std::cout <<
"Ended job " << thread_counter << std::endl;
77 unsigned int nthread = 10;
79 unsigned int *thread_id =
new unsigned int[nthread];
81 for (
unsigned int i = 0; i < nthread; i++) {
95 #if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX 96 std::cout <<
"You should enable pthread usage and rebuild ViSP..." << std::endl;
98 std::cout <<
"Multi-threading seems not supported on this platform" << std::endl;
void create(vpThread::Fn fn, vpThread::Args args=NULL)