Skip to content

Commit

Permalink
repair broken sync test
Browse files Browse the repository at this point in the history
  • Loading branch information
David Vorick committed Apr 21, 2017
1 parent 56b0bd8 commit 565401a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions sync/tryrwmutex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,13 @@ func TestTryRWMutexReadUnavailable(t *testing.T) {
t.Fatal("Data should not have changed while under readlock")
}

// Release the lock and wait for the other locks to finish their
// modifications.
tm.RUnlock()

// Try to grab another readlock. It should succeed. The data should have
// changed.
// Try to grab another readlock. It should not succeed.
if tm.TryRLock() {
t.Fatal("Able to get readlock on available TryRWMutex")
}

// Release the lock and wait for the other locks to finish their
// modifications.
tm.RUnlock()
wg.Wait()
}

0 comments on commit 565401a

Please sign in to comment.