HorizenOfficial / zend_oo

This repository is archived, Zendoo is out of beta and has been included in https://github.com/HorizenOfficial/zen.
https://github.com/HorizenOfficial/zen
Other
34 stars 22 forks source link

DEBUG_LOCKCONTENTION macro is never activated #210

Open ptagl opened 3 years ago

ptagl commented 3 years ago

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