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

Delta Between Two Patch Sets: src/pkg/runtime/netpoll.goc

Issue 12418043: code review 12418043: net: add special netFD mutex (Closed)
Left Patch Set: diff -r 1169c3ec0059 https://dvyukov%40google.com@code.google.com/p/go/ Created 11 years, 7 months ago
Right Patch Set: diff -r 5a51d54e34bb https://dvyukov%40google.com@code.google.com/p/go/ Created 11 years, 7 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/runtime/mprof.goc ('k') | src/pkg/runtime/proc.c » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2013 The Go Authors. All rights reserved. 1 // Copyright 2013 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,amd64 freebsd,386 linux openbsd windows 5 // +build darwin freebsd,amd64 freebsd,386 linux openbsd windows
6 6
7 package net 7 package net
8 8
9 #include "runtime.h" 9 #include "runtime.h"
10 #include "defs_GOOS_GOARCH.h" 10 #include "defs_GOOS_GOARCH.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 } 207 }
208 208
209 func runtime_Semacquire(addr *uint32) { 209 func runtime_Semacquire(addr *uint32) {
210 runtime·semacquire(addr, true); 210 runtime·semacquire(addr, true);
211 } 211 }
212 212
213 func runtime_Semrelease(addr *uint32) { 213 func runtime_Semrelease(addr *uint32) {
214 runtime·semrelease(addr); 214 runtime·semrelease(addr);
215 } 215 }
216 216
217 uintptr
218 runtime·netpollfd(PollDesc *pd)
219 {
220 return pd->fd;
221 }
222
217 // make pd ready, newly runnable goroutines (if any) are enqueued info gpp list 223 // make pd ready, newly runnable goroutines (if any) are enqueued info gpp list
218 void 224 void
219 runtime·netpollready(G **gpp, PollDesc *pd, int32 mode) 225 runtime·netpollready(G **gpp, PollDesc *pd, int32 mode)
220 { 226 {
221 G *rg, *wg; 227 G *rg, *wg;
222 228
223 rg = wg = nil; 229 rg = wg = nil;
224 runtime·lock(pd); 230 runtime·lock(pd);
225 if(mode == 'r' || mode == 'r'+'w') 231 if(mode == 'r' || mode == 'r'+'w')
226 rg = netpollunblock(pd, 'r', true); 232 rg = netpollunblock(pd, 'r', true);
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 for(i = 0; i < n; i++) { 375 for(i = 0; i < n; i++) {
370 pd[i].link = pollcache.first; 376 pd[i].link = pollcache.first;
371 pollcache.first = &pd[i]; 377 pollcache.first = &pd[i];
372 } 378 }
373 } 379 }
374 pd = pollcache.first; 380 pd = pollcache.first;
375 pollcache.first = pd->link; 381 pollcache.first = pd->link;
376 runtime·unlock(&pollcache); 382 runtime·unlock(&pollcache);
377 return pd; 383 return pd;
378 } 384 }
LEFTRIGHT

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