mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 11:48:55 +01:00
internal/ui: use RLock/RUnlock whenever possible
This commit is contained in:
parent
4fb27adb9d
commit
fab08bac92
@ -204,8 +204,8 @@ func (u *userInterfaceImpl) setInitMonitor(m *Monitor) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (u *userInterfaceImpl) getInitMonitor() *Monitor {
|
func (u *userInterfaceImpl) getInitMonitor() *Monitor {
|
||||||
u.m.Lock()
|
u.m.RLock()
|
||||||
defer u.m.Unlock()
|
defer u.m.RUnlock()
|
||||||
return u.initMonitor
|
return u.initMonitor
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -450,10 +450,9 @@ func (u *userInterfaceImpl) getInitWindowSizeInDIP() (int, int) {
|
|||||||
return microsoftgdk.MonitorResolution()
|
return microsoftgdk.MonitorResolution()
|
||||||
}
|
}
|
||||||
|
|
||||||
u.m.Lock()
|
u.m.RLock()
|
||||||
w, h := u.initWindowWidthInDIP, u.initWindowHeightInDIP
|
defer u.m.RUnlock()
|
||||||
u.m.Unlock()
|
return u.initWindowWidthInDIP, u.initWindowHeightInDIP
|
||||||
return w, h
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *userInterfaceImpl) setInitWindowSizeInDIP(width, height int) {
|
func (u *userInterfaceImpl) setInitWindowSizeInDIP(width, height int) {
|
||||||
|
Loading…
Reference in New Issue
Block a user