Add some Barrier statements to prevent race conditions.