Protect all transactions with mutex.