Primitives for Contract-based Synchronization