0

I tried to check if a thread is running with use of timed_join(0). But unlike others, I get this error:

1>c:...\boost\thread\detail\thread.hpp(538): error C2679: binary '+' : no operator found which takes a right-hand operand of type 'const int' (or there is no acceptable conversion)

It looks like the timed_join() is not correctly defined to use int. But how come I am the only one who got this error? (try to search the title, I got 3 total results at google)

Sam Miller
  • 23,808
  • 4
  • 67
  • 87
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778

1 Answers1

0

Note that timed_join() is deprecated in recent versions of boost, the documentation overview describes the rationale for this in greater detail. It looks like this interface will be removed after boost 1.56. In any case, the correct usage of timed_join() is to supply a posix_time value, such as

thread.timed_join(boost::posix_time::milliseconds(0))
Sam Miller
  • 23,808
  • 4
  • 67
  • 87