~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

Viewing changes to src/pkg/net/rpc/client.go

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2014-11-18 15:12:26 UTC
  • mfrom: (14.2.12 vivid-proposed)
  • Revision ID: package-import@ubuntu.com-20141118151226-zug7vn93mn3dtiz3
Tags: 2:1.3.2-1ubuntu1
* Merge from Debian unstable.  Remaining changes:
  - 016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.
  - Support co-installability with gccgo-go tool:
    - d/rules,golang-go.install: Rename bin/go -> bin/golang-go
    - d/golang-go.{postinst,prerm}: Install/remove /usr/bin/go using
      alternatives.
  - d/copyright: Amendments for full compiliance with copyright format.
  - d/control: Demote golang-go.tools to Suggests to support Ubuntu MIR.
  - dropped patches (now upstream):
    - d/p/issue27650045_40001_50001.diff
    - d/p/issue28050043_60001_70001.diff
    - d/p/issue54790044_100001_110001.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
// with a single Client, and a Client may be used by
40
40
// multiple goroutines simultaneously.
41
41
type Client struct {
42
 
        mutex    sync.Mutex // protects pending, seq, request
43
 
        sending  sync.Mutex
 
42
        codec ClientCodec
 
43
 
 
44
        sending sync.Mutex
 
45
 
 
46
        mutex    sync.Mutex // protects following
44
47
        request  Request
45
48
        seq      uint64
46
 
        codec    ClientCodec
47
49
        pending  map[uint64]*Call
48
 
        closing  bool
49
 
        shutdown bool
 
50
        closing  bool // user has called Close
 
51
        shutdown bool // server has told us to stop
50
52
}
51
53
 
52
54
// A ClientCodec implements writing of RPC requests and
274
276
 
275
277
func (client *Client) Close() error {
276
278
        client.mutex.Lock()
277
 
        if client.shutdown || client.closing {
 
279
        if client.closing {
278
280
                client.mutex.Unlock()
279
281
                return ErrShutdown
280
282
        }