mirror of
https://github.com/golang/go
synced 2024-09-15 22:20:06 +00:00
encoding/gob: mention that Encoder and Decoder are safe for concurrent use
Fixes #29416. Change-Id: I24364bfee77aceace53f85f1046ef4d73f8feebb
This commit is contained in:
parent
55e3aced9e
commit
ad9f311457
|
@ -18,7 +18,8 @@ import (
|
||||||
const tooBig = (1 << 30) << (^uint(0) >> 62)
|
const tooBig = (1 << 30) << (^uint(0) >> 62)
|
||||||
|
|
||||||
// A Decoder manages the receipt of type and data information read from the
|
// 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,
|
// The Decoder does only basic sanity checking on decoded input sizes,
|
||||||
// and its limits are not configurable. Take caution when decoding gob data
|
// and its limits are not configurable. Take caution when decoding gob data
|
||||||
|
|
|
@ -12,7 +12,8 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// An Encoder manages the transmission of type and data information to the
|
// 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 {
|
type Encoder struct {
|
||||||
mutex sync.Mutex // each item must be sent atomically
|
mutex sync.Mutex // each item must be sent atomically
|
||||||
w []io.Writer // where to send the data
|
w []io.Writer // where to send the data
|
||||||
|
|
Loading…
Reference in a new issue