mirror of
https://github.com/golang/go
synced 2024-11-07 12:26:16 -07:00
0435e88a11
This reverts commit ab4c9298b8
.
Sysmon critically depends on system timer resolution for retaking
of Ps blocked in system calls. See #14790 for an example
of a program where execution time goes from 2ms to 30ms if
timeBeginPeriod(1) is not used.
We can remove timeBeginPeriod(1) when we support UMS (#7876).
Update #14790
Change-Id: I362b56154359b2c52d47f9f2468fe012b481cf6d
Reviewed-on: https://go-review.googlesource.com/20834
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Dmitry Vyukov <dvyukov@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
26 lines
652 B
Go
26 lines
652 B
Go
// Copyright 2014 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// Export guts for testing.
|
|
|
|
package runtime
|
|
|
|
import "unsafe"
|
|
|
|
var (
|
|
TestingWER = &testingWER
|
|
OsYield = osyield
|
|
TimeBeginPeriodRetValue = &timeBeginPeriodRetValue
|
|
)
|
|
|
|
func NumberOfProcessors() int32 {
|
|
var info systeminfo
|
|
stdcall1(_GetSystemInfo, uintptr(unsafe.Pointer(&info)))
|
|
return int32(info.dwnumberofprocessors)
|
|
}
|
|
|
|
func LoadLibraryExStatus() (useEx, haveEx, haveFlags bool) {
|
|
return useLoadLibraryEx, _LoadLibraryExW != nil, _AddDllDirectory != nil
|
|
}
|