mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +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 {
|
||||
u.m.Lock()
|
||||
defer u.m.Unlock()
|
||||
u.m.RLock()
|
||||
defer u.m.RUnlock()
|
||||
return u.initMonitor
|
||||
}
|
||||
|
||||
@ -450,10 +450,9 @@ func (u *userInterfaceImpl) getInitWindowSizeInDIP() (int, int) {
|
||||
return microsoftgdk.MonitorResolution()
|
||||
}
|
||||
|
||||
u.m.Lock()
|
||||
w, h := u.initWindowWidthInDIP, u.initWindowHeightInDIP
|
||||
u.m.Unlock()
|
||||
return w, h
|
||||
u.m.RLock()
|
||||
defer u.m.RUnlock()
|
||||
return u.initWindowWidthInDIP, u.initWindowHeightInDIP
|
||||
}
|
||||
|
||||
func (u *userInterfaceImpl) setInitWindowSizeInDIP(width, height int) {
|
||||
|
Loading…
Reference in New Issue
Block a user