aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/io
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2012-03-06 17:57:23 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2012-03-06 17:57:23 +0000
commit593f74bbab63d34c7060918088bcbad686c31c66 (patch)
tree4ce83ca433796a728e9fdd00af105bce158532b5 /libgo/go/io
parent46402cbe0ba3ea92be9642cf18eedaefe57a414c (diff)
downloadgcc-593f74bbab63d34c7060918088bcbad686c31c66.zip
gcc-593f74bbab63d34c7060918088bcbad686c31c66.tar.gz
gcc-593f74bbab63d34c7060918088bcbad686c31c66.tar.bz2
libgo: Update to weekly.2012-03-04 release.
From-SVN: r185010
Diffstat (limited to 'libgo/go/io')
-rw-r--r--libgo/go/io/io.go7
-rw-r--r--libgo/go/io/pipe.go4
2 files changed, 11 insertions, 0 deletions
diff --git a/libgo/go/io/io.go b/libgo/go/io/io.go
index bbfa6c2..7074834 100644
--- a/libgo/go/io/io.go
+++ b/libgo/go/io/io.go
@@ -6,6 +6,10 @@
// Its primary job is to wrap existing implementations of such primitives,
// such as those in package os, into shared public interfaces that
// abstract the functionality, plus some other related primitives.
+//
+// Because these interfaces and primitives wrap lower-level operations with
+// various implementations, unless otherwise informed clients should not
+// assume they are safe for parallel execution.
package io
import (
@@ -156,6 +160,9 @@ type WriterTo interface {
// If ReadAt is reading from an input source with a seek offset,
// ReadAt should not affect nor be affected by the underlying
// seek offset.
+//
+// Clients of ReadAt can execute parallel ReadAt calls on the
+// same input source.
type ReaderAt interface {
ReadAt(p []byte, off int64) (n int, err error)
}
diff --git a/libgo/go/io/pipe.go b/libgo/go/io/pipe.go
index cf05e0c1..f3f0f17 100644
--- a/libgo/go/io/pipe.go
+++ b/libgo/go/io/pipe.go
@@ -175,6 +175,10 @@ func (w *PipeWriter) CloseWithError(err error) error {
// with code expecting an io.Writer.
// Reads on one end are matched with writes on the other,
// copying data directly between the two; there is no internal buffering.
+// It is safe to call Read and Write in parallel with each other or with
+// Close. Close will complete once pending I/O is done. Parallel calls to
+// Read, and parallel calls to Write, are also safe:
+// the individual calls will be gated sequentially.
func Pipe() (*PipeReader, *PipeWriter) {
p := new(pipe)
p.rwait.L = &p.l