Better buffer synchronization macro.