lib/thread: add macro for debug printing of threading

This is analogous to DEBUG_DATABASE_SANITY, and is intended to help
debugging and to help users submit bug reports.
This commit is contained in:
David Bremner 2018-09-03 11:00:26 -03:00
parent d0b844b358
commit 040fd630bf
2 changed files with 7 additions and 0 deletions

View file

@ -56,6 +56,7 @@ NOTMUCH_BEGIN_DECLS
#ifdef DEBUG
# define DEBUG_DATABASE_SANITY 1
# define DEBUG_THREADING 1
# define DEBUG_QUERY 1
#endif

View file

@ -24,6 +24,12 @@
#include <gmime/gmime.h>
#include <glib.h> /* GHashTable */
#ifdef DEBUG_THREADING
#define THREAD_DEBUG(format, ...) fprintf(stderr, format " (%s).\n", ##__VA_ARGS__, __location__)
#else
#define THREAD_DEBUG(format, ...) do {} while (0) /* ignored */
#endif
#define EMPTY_STRING(s) ((s)[0] == '\0')
struct _notmuch_thread {