// Copy creates a copy of all the lock state held by l.
Copy creates a copy of all the lock state held by l.
// Copy creates a copy of all the lock state held by l .
func (l *locksHeld) Copy() *locksHeld {
	out := &locksHeld{locks: make(map[ssa.Value]mutexState)}
	for ssaVal, mState := range l.locks {
		newLM := make(map[int]struct{})
		for k, v := range mState.lockedMutexes {
			newLM[k] = v
		}
		out.locks[ssaVal] = mutexState{lockedMutexes: newLM}
	}
	return out
}
func ( l * locksHeld ) Copy ( ) * locksHeld { out := & locksHeld { locks : make ( map [ ssa . Value ] mutexState ) } for ssaVal , mState := range l . locks { newLM := make ( map [ int ] struct { } ) for k , v := range mState . lockedMutexes { newLM [ k ] = v } out . locks [ ssaVal ] = mutexState { lockedMutexes : newLM } } return out }
Copy creates a copy of all the lock state held by l.
Copy creates a copy of all the lock state held by l .