diff --git a/syncutil/invariant_mutex.go b/syncutil/invariant_mutex.go
index <HASH>..<HASH> 100644
--- a/syncutil/invariant_mutex.go
+++ b/syncutil/invariant_mutex.go
@@ -103,11 +103,18 @@ func (i *InvariantMutex) checkIfEnabled() {
 // by the mutex should hold (e.g. just after acquiring the lock). The function
 // should crash if an invariant is violated. It should not have side effects,
 // as there are no guarantees that it will run.
+//
+// The invariants must hold at the time that NewInvariantMutex is called.
 func NewInvariantMutex(check func()) InvariantMutex {
 	if check == nil {
 		panic("check must be non-nil.")
 	}
 
+	// Check now, if enabled.
+	if *fCheckInvariants {
+		check()
+	}
+
 	return InvariantMutex{
 		check: check,
 	}
Check invariants when creating the mutex, too.