mirror of
https://github.com/golang/go
synced 2024-11-19 14:54:43 -07:00
runtime: do not profile blocked netpoll on windows
There is frequently a thread hanging on GQCS, currently it skews profiles towards netpoll, but it is not bad and is not consuming any resources. R=alex.brainman CC=golang-codereviews https://golang.org/cl/61560043
This commit is contained in:
parent
120218afeb
commit
e5a4211b36
@ -94,13 +94,17 @@ retry:
|
||||
n = nelem(entries) / runtime·gomaxprocs;
|
||||
if(n < 8)
|
||||
n = 8;
|
||||
if(block)
|
||||
m->blocked = true;
|
||||
if(runtime·stdcall(runtime·GetQueuedCompletionStatusEx, 6, iocphandle, entries, (uintptr)n, &n, (uintptr)wait, (uintptr)0) == 0) {
|
||||
m->blocked = false;
|
||||
errno = runtime·getlasterror();
|
||||
if(!block && errno == WAIT_TIMEOUT)
|
||||
return nil;
|
||||
runtime·printf("netpoll: GetQueuedCompletionStatusEx failed (errno=%d)\n", errno);
|
||||
runtime·throw("netpoll: GetQueuedCompletionStatusEx failed");
|
||||
}
|
||||
m->blocked = false;
|
||||
for(i = 0; i < n; i++) {
|
||||
op = entries[i].op;
|
||||
errno = 0;
|
||||
@ -113,7 +117,10 @@ retry:
|
||||
op = nil;
|
||||
errno = 0;
|
||||
qty = 0;
|
||||
if(block)
|
||||
m->blocked = true;
|
||||
if(runtime·stdcall(runtime·GetQueuedCompletionStatus, 5, iocphandle, &qty, &key, &op, (uintptr)wait) == 0) {
|
||||
m->blocked = false;
|
||||
errno = runtime·getlasterror();
|
||||
if(!block && errno == WAIT_TIMEOUT)
|
||||
return nil;
|
||||
@ -123,6 +130,7 @@ retry:
|
||||
}
|
||||
// dequeued failed IO packet, so report that
|
||||
}
|
||||
m->blocked = false;
|
||||
handlecompletion(&gp, op, errno, qty);
|
||||
}
|
||||
if(block && gp == nil)
|
||||
|
Loading…
Reference in New Issue
Block a user