Boost logo

Boost Users :

Subject: Re: [Boost-users] compilation flag effect on boost::condition::timed_wait()
From: Viatcheslav.Sysoltsev_at_[hidden]
Date: 2011-02-03 10:35:14


> Dear All,
>
> I am getting different behaviour of condition::timed_wait() function
> when I compile my code with NDEBUG flag and without NDEBUG flag.
>
> with using NDEBUG flag, timed_wait() wait for condition (mutext) as
> desired but whey I don't use NDEBUG flag while compiling my code it does
> wait for condition (mutex) but return at the same time when it is
> called. In both the cases return value is 1.
>
> Please note that it is not a race condition but it is happening every
> time.
>
> Also note that I am using other flags too for compiling my code like
>
> -Werror -pthread -fno-strict-aliasing -Wno-unused-variable
> -Wno-unused-parameter -Wno-unused-function -O3 -ggdb3 -m64
>
>
> Please let me know what can be possible impact of NDEBUG flag on
> timed_wait() function.
>
>
> Thanking you
> Vishal

Hi Vishal,

which boost version are you referring to? The 1.45 is a little different
 from previous releases in condition_variable_any.
Also, if you can compile yout code with -g -O0 -DNDEBUG, is the behaviour
reproducible? If so, can you step the timed_wait() function in debugger,
do you see anything strange?

Consider as well, most sort of assert macroses are defined into nothing in
release build, so make sure you don't do anything usefull in assert
expression.

Happy hunting ;)
-- Slava


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net