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

Delta Between Two Patch Sets: src/pkg/syscall/syscall_windows.go

Issue 6610064: code review 6610064: race: syscall changes (Closed)
Left Patch Set: diff -r 7b037816cd5c https://dvyukov%40google.com@code.google.com/p/go/ Created 12 years, 5 months ago
Right Patch Set: diff -r b9906e2737fa https://go.googlecode.com/hg/ Created 12 years, 5 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/syscall/syscall_unix.go ('k') | src/pkg/syscall/zsyscall_darwin_386.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 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 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 // Windows system calls. 5 // Windows system calls.
6 6
7 package syscall 7 package syscall
8 8
9 import ( 9 import (
10 "unicode/utf16" 10 "unicode/utf16"
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 func Read(fd Handle, p []byte) (n int, err error) { 260 func Read(fd Handle, p []byte) (n int, err error) {
261 var done uint32 261 var done uint32
262 e := ReadFile(fd, p, &done, nil) 262 e := ReadFile(fd, p, &done, nil)
263 if e != nil { 263 if e != nil {
264 if e == ERROR_BROKEN_PIPE { 264 if e == ERROR_BROKEN_PIPE {
265 // NOTE(brainman): work around ERROR_BROKEN_PIPE is retu rned on reading EOF from stdin 265 // NOTE(brainman): work around ERROR_BROKEN_PIPE is retu rned on reading EOF from stdin
266 return 0, nil 266 return 0, nil
267 } 267 }
268 return 0, e 268 return 0, e
269 } 269 }
270 if raceenabled {
271 raceAcquire(unsafe.Pointer(&ioSync))
272 }
270 return int(done), nil 273 return int(done), nil
271 } 274 }
272 275
273 func Write(fd Handle, p []byte) (n int, err error) { 276 func Write(fd Handle, p []byte) (n int, err error) {
277 if raceenabled {
278 raceReleaseMerge(unsafe.Pointer(&ioSync))
279 }
274 var done uint32 280 var done uint32
275 e := WriteFile(fd, p, &done, nil) 281 e := WriteFile(fd, p, &done, nil)
276 if e != nil { 282 if e != nil {
277 return 0, e 283 return 0, e
278 } 284 }
279 return int(done), nil 285 return int(done), nil
280 } 286 }
287
288 var ioSync int64
281 289
282 func Seek(fd Handle, offset int64, whence int) (newoffset int64, err error) { 290 func Seek(fd Handle, offset int64, whence int) (newoffset int64, err error) {
283 var w uint32 291 var w uint32
284 switch whence { 292 switch whence {
285 case 0: 293 case 0:
286 w = FILE_BEGIN 294 w = FILE_BEGIN
287 case 1: 295 case 1:
288 w = FILE_CURRENT 296 w = FILE_CURRENT
289 case 2: 297 case 2:
290 w = FILE_END 298 w = FILE_END
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 795
788 func (s Signal) String() string { 796 func (s Signal) String() string {
789 if 0 <= s && int(s) < len(signals) { 797 if 0 <= s && int(s) < len(signals) {
790 str := signals[s] 798 str := signals[s]
791 if str != "" { 799 if str != "" {
792 return str 800 return str
793 } 801 }
794 } 802 }
795 return "signal " + itoa(int(s)) 803 return "signal " + itoa(int(s))
796 } 804 }
LEFTRIGHT

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