Assert statements are compiled out if NDEBUG is defined. Hence make sure
that the expressions passed to assert do not have side effects.
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
struct io_u *__get_io_u(struct thread_data *td)
{
struct io_u *io_u = NULL;
struct io_u *__get_io_u(struct thread_data *td)
{
struct io_u *io_u = NULL;
if (td->stop_io)
return NULL;
if (td->stop_io)
return NULL;
* return one
*/
assert(!(td->flags & TD_F_CHILD));
* return one
*/
assert(!(td->flags & TD_F_CHILD));
- assert(!pthread_cond_wait(&td->free_cond, &td->io_u_lock));
+ ret = pthread_cond_wait(&td->free_cond, &td->io_u_lock);
+ assert(ret == 0);