Removed use of atomics when using boost, this is a bit dodgy but will do for now