Threading and synchronization utilities.