]> Cypherpunks repositories - gostls13.git/commitdiff
encoding/gob: mention that Encoder and Decoder are safe for concurrent use
authorMostyn Bramley-Moore <mostyn@antipode.se>
Fri, 28 Dec 2018 20:02:13 +0000 (20:02 +0000)
committerIan Lance Taylor <iant@golang.org>
Fri, 28 Dec 2018 22:14:11 +0000 (22:14 +0000)
Fixes #29416

Change-Id: I24364bfee77aceace53f85f1046ef4d73f8feebb

Change-Id: I24364bfee77aceace53f85f1046ef4d73f8feebb
GitHub-Last-Rev: ad9f31145763dc16f53dd9f3154667b162759f69
GitHub-Pull-Request: golang/go#29417
Reviewed-on: https://go-review.googlesource.com/c/155742
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/encoding/gob/decoder.go
src/encoding/gob/encoder.go

index f4f740ef4227cd5b6b2f9e8b10fe0882239f45cf..b52aabe54b532df5d233a7f7151514a0f94a7a3f 100644 (file)
@@ -18,7 +18,8 @@ import (
 const tooBig = (1 << 30) << (^uint(0) >> 62)
 
 // A Decoder manages the receipt of type and data information read from the
-// remote side of a connection.
+// remote side of a connection.  It is safe for concurrent use by multiple
+// goroutines.
 //
 // The Decoder does only basic sanity checking on decoded input sizes,
 // and its limits are not configurable. Take caution when decoding gob data
index 40ec81b6e69360945661fe52a13a04cb7ffd6455..53e2cace1667457a2ff11f1f5c6a1b3d66830d99 100644 (file)
@@ -12,7 +12,8 @@ import (
 )
 
 // An Encoder manages the transmission of type and data information to the
-// other side of a connection.
+// other side of a connection.  It is safe for concurrent use by multiple
+// goroutines.
 type Encoder struct {
        mutex      sync.Mutex              // each item must be sent atomically
        w          []io.Writer             // where to send the data