Test threading capabilities.
#include <visp3/core/vpConfig.h>
#if defined(VISP_HAVE_PTHREAD) || (defined(_WIN32) && !defined(WINRT_8_0))
#include <iostream>
#include <visp3/core/vpThread.h>
#include <visp3/core/vpTime.h>
{
(void)(args);
return 0;
}
{
(void)(args);
return 0;
}
{
unsigned int args_ = *((unsigned int *) args);
std::cout << "qux arg: " << args_ << std::endl;
return 0;
}
int main()
{
unsigned int qux_arg = 12;
std::cout << "Joinable after construction:" << std::endl;
std::cout <<
"foo: " << foo.
joinable() << std::endl;
std::cout << "bar: " << bar.joinable() << std::endl;
std::cout << "qux: " << qux.joinable() << std::endl;
std::cout << "Joinable after creation:" << std::endl;
std::cout <<
"foo: " << foo.
joinable() << std::endl;
std::cout << "bar: " << bar.joinable() << std::endl;
std::cout << "qux: " << qux.joinable() << std::endl;
if (bar.joinable()) bar.join();
if (qux.joinable()) qux.join();
std::cout << "Joinable after joining:" << std::endl;
std::cout <<
"foo: " << foo.
joinable() << std::endl;
std::cout << "bar: " << bar.joinable() << std::endl;
std::cout << "qux: " << qux.joinable() << std::endl;
return 0;
}
#else
#include <iostream>
int main()
{
# if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX
std::cout << "You should enable pthread usage and rebuild ViSP..." << std::endl;
# else
std::cout << "Multi-threading seems not supported on this platform" << std::endl;
# endif
}
#endif