boostorg / thread

Boost.org thread module
http://boost.org/libs/thread
199 stars 161 forks source link

Fixed warning cast between incompatible function types from FARPROC_ to gettickcount64_t #227

Closed kivadiu closed 6 years ago

kivadiu commented 6 years ago

On Windows, GetProcAddress must be cast to something useful which generates a warning with gcc. This patch silents the warning.

Fixes issue #225

kivadiu commented 6 years ago

I am very surprised by test failures in completely unrelated code. For example, it fails with msvc-11 (but not with 9, 10 and 12) at test/threads/thread/members/try_join_for_pass.cpp:147:

boost::thread t0( (G()));
BOOST_TEST(t0.joinable());
t0.try_join_for(boost::chrono::milliseconds(250));
try
{
  t0.join();
  BOOST_TEST(false); // line 147: test failure here
}
catch (boost::system::system_error& e)
{
  BOOST_TEST(e.code().value() == boost::system::errc::invalid_argument);
}

Is it possible that the test server is so heavily loaded that 250 ms are not enough and t0.join() does not fail as expected?

Lastique commented 6 years ago

It is possible, as with any other time-based test.

viboes commented 6 years ago

Andrey is right. This kind of tests can unfortunately fail.

kivadiu commented 6 years ago

How do you normally decide if a patch is harmless then?

viboes commented 6 years ago

I need to check the kind of issue :(