rpc/stream/vc/writer: Remove defer statement.
Found another one in writer.
v23 go test -bench=Benchmark_100KB -cpu=1 -benchtime=20s v.io/x/ref/runtime/internal/rpc/benchmark
Benchmark_100KB 10000 2299916 ns/op 86.96 MB/s
--- Histogram (unit: ms)
Count: 10000 Min: 1 Max: 9 Avg: 1.62
------------------------------------------------------------
[ 1, 2) 5927 59.3% 59.3% ######
[ 2, 3) 2085 20.9% 80.1% ##
[ 3, 4) 1924 19.2% 99.4% ##
[ 4, 5) 22 0.2% 99.6%
[ 5, 6) 39 0.4% 100.0%
[ 6, 8) 1 0.0% 100.0%
[ 8, 10) 2 0.0% 100.0%
[ 10, 12) 0 0.0% 100.0%
[ 12, inf) 0 0.0% 100.0%
ok v.io/x/ref/runtime/internal/rpc/benchmark 23.626s
Benchmark_100KB 10000 2240760 ns/op 89.26 MB/s
--- Histogram (unit: ms)
Count: 10000 Min: 1 Max: 5 Avg: 1.56
------------------------------------------------------------
[ 1, 2) 6190 61.9% 61.9% ######
[ 2, 3) 1989 19.9% 81.8% ##
[ 3, 4) 1809 18.1% 99.9% ##
[ 4, 5) 10 0.1% 100.0%
[ 5, inf) 2 0.0% 100.0%
ok v.io/x/ref/runtime/internal/rpc/benchmark 23.115s
Change-Id: I82f96a681de8375372eab25bba9bae94ca17e020
diff --git a/runtime/internal/rpc/stream/vc/writer.go b/runtime/internal/rpc/stream/vc/writer.go
index 32f51d3..684a357 100644
--- a/runtime/internal/rpc/stream/vc/writer.go
+++ b/runtime/internal/rpc/stream/vc/writer.go
@@ -173,8 +173,8 @@
func (w *writer) SetDeadline(deadline <-chan struct{}) {
w.mu.Lock()
- defer w.mu.Unlock()
w.deadline = deadline
+ w.mu.Unlock()
}
// Release allows the next 'bytes' of data to be removed from the buffer queue