zend_oo icon indicating copy to clipboard operation
zend_oo copied to clipboard

DEBUG_LOCKCONTENTION macro is never activated

Open ptagl opened this issue 3 years ago • 0 comments

There are some code sections enabled/disabled by the macro DEBUG_LOCKCONTENTION but this macro is never activated during the compilation of Zendoo. We should restore it in debug mode, since it might be very useful when looking for deadlocks.

Possible solution

In the file configure.ac change the section

if test "x$enable_debug" = xyes; then
    CPPFLAGS="$CPPFLAGS -DDEBUG -DDEBUG_LOCKORDER"
    if test "x$GCC" = xyes; then
        CFLAGS="$CFLAGS -g3 -O0"
    fi

    if test "x$GXX" = xyes; then
        CXXFLAGS="$CXXFLAGS -g3 -O0"
    fi
fi

to

if test "x$enable_debug" = xyes; then
    CPPFLAGS="$CPPFLAGS -DDEBUG -DDEBUG_LOCKORDER -DDEBUG_LOCKCONTENTION"
    if test "x$GCC" = xyes; then
        CFLAGS="$CFLAGS -g3 -O0"
    fi

    if test "x$GXX" = xyes; then
        CXXFLAGS="$CXXFLAGS -g3 -O0"
    fi
fi

ptagl avatar Oct 14 '21 11:10 ptagl