Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(595)

Delta Between Two Patch Sets: src/pkg/net/newpollserver_unix.go

Issue 6460108: net: epoll dispatcher 2
Left Patch Set: diff -r 29990fa0951c https://dvyukov%40google.com@code.google.com/p/go/ Created 11 years, 6 months ago
Right Patch Set: diff -r f2755950769b https://dvyukov%40google.com@code.google.com/p/go/ Created 11 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/net/fd_unix_test.go ('k') | src/pkg/net/sock_posix.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 // Copyright 2010 The Go Authors. All rights reserved. 1 // Copyright 2010 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // +build darwin freebsd linux netbsd openbsd 5 // +build darwin freebsd netbsd openbsd
6 6
7 package net 7 package net
8
9 import (
10 "os"
11 "syscall"
12 )
13
14 func newPollServer() (s *pollServer, err error) {
15 s = new(pollServer)
16 if s.pr, s.pw, err = os.Pipe(); err != nil {
17 return nil, err
18 }
19 if err = syscall.SetNonblock(int(s.pr.Fd()), true); err != nil {
20 goto Errno
21 }
22 if err = syscall.SetNonblock(int(s.pw.Fd()), true); err != nil {
23 goto Errno
24 }
25 if s.poll, err = newpollster(); err != nil {
26 goto Error
27 }
28 if _, err = s.poll.AddFD(int(s.pr.Fd()), 'r', true); err != nil {
29 s.poll.Close()
30 goto Error
31 }
32 s.pending = make(map[int]*netFD)
33 go s.Run()
34 return s, nil
35
36 Errno:
37 err = &os.PathError{
38 Op: "setnonblock",
39 Path: s.pr.Name(),
40 Err: err,
41 }
42 Error:
43 s.pr.Close()
44 s.pw.Close()
45 return nil, err
46 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b