Add a global barrier that doesn't work yet.  Improve the debugging infrastructure by creating a dedicated thread to flush the debug log.