#include <stdbool.h>
#include <stdint.h>
+#include <pthread.h>
+
+// a global mutex to prevent interlaced printing from different threads
+pthread_mutex_t print_lock;
+extern uint8_t g_debugMode;
void ShowGui(void);
void HideGraphWindow(void);
extern double CursorScaleFactor;
extern int PlotGridX, PlotGridY, PlotGridXdefault, PlotGridYdefault, CursorCPos, CursorDPos, GridOffset;
-extern int offline;
-extern int flushAfterWrite; //buzzy
+extern bool flushAfterWrite; //buzzy
extern bool GridLocked;
extern bool showDemod;