aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Vyukov <dvyukov@google.com>2011-08-16 18:33:48 +1000
committerAndrew Gerrand <adg@golang.org>2011-08-16 18:33:48 +1000
commit381f6a2eebb7f0a43d2c69910dc388c076a0dc93 (patch)
treeb8cb6f8868df91559d72e44792d64536d5df25dd
parent00dd2b4ab92b4491466196d69942ccb9eb5b4721 (diff)
downloadgo-381f6a2eebb7f0a43d2c69910dc388c076a0dc93.tar.gz
go-381f6a2eebb7f0a43d2c69910dc388c076a0dc93.zip
syscall: make LazyDLL/LazyProc.Mutex unexported
They are seemingly not intended to be a part of the public interface. R=golang-dev, adg CC=golang-dev https://golang.org/cl/4873052
-rw-r--r--src/pkg/syscall/syscall_windows.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pkg/syscall/syscall_windows.go b/src/pkg/syscall/syscall_windows.go
index 05887da820..19c6587f52 100644
--- a/src/pkg/syscall/syscall_windows.go
+++ b/src/pkg/syscall/syscall_windows.go
@@ -90,7 +90,7 @@ func getprocaddress(handle uintptr, procname uintptr) (proc uintptr)
// call to its Handle method or to one of its
// LazyProc's Addr method.
type LazyDLL struct {
- sync.Mutex
+ mu sync.Mutex
Name string
h uintptr // module handle once dll is loaded
}
@@ -98,8 +98,8 @@ type LazyDLL struct {
// Handle returns d's module handle.
func (d *LazyDLL) Handle() uintptr {
if d.h == 0 {
- d.Lock()
- defer d.Unlock()
+ d.mu.Lock()
+ defer d.mu.Unlock()
if d.h == 0 {
d.h = loadlibraryex(uintptr(unsafe.Pointer(StringBytePtr(d.Name))))
if d.h == 0 {
@@ -123,7 +123,7 @@ func NewLazyDLL(name string) *LazyDLL {
// A LazyProc implements access to a procedure inside a LazyDLL.
// It delays the lookup until the Addr method is called.
type LazyProc struct {
- sync.Mutex
+ mu sync.Mutex
Name string
dll *LazyDLL
addr uintptr
@@ -133,8 +133,8 @@ type LazyProc struct {
// The return value can be passed to Syscall to run the procedure.
func (s *LazyProc) Addr() uintptr {
if s.addr == 0 {
- s.Lock()
- defer s.Unlock()
+ s.mu.Lock()
+ defer s.mu.Unlock()
if s.addr == 0 {
s.addr = getprocaddress(s.dll.Handle(), uintptr(unsafe.Pointer(StringBytePtr(s.Name))))
if s.addr == 0 {