mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-04 07:29:56 +08:00
19 lines
421 B
Go
19 lines
421 B
Go
//go:build linux
|
|
|
|
package application
|
|
|
|
func (a *linuxApp) dispatchOnMainThread(id uint) {
|
|
dispatchOnMainThread(id)
|
|
}
|
|
|
|
func executeOnMainThread(callbackID uint) {
|
|
mainThreadFunctionStoreLock.RLock()
|
|
fn := mainThreadFunctionStore[callbackID]
|
|
if fn == nil {
|
|
Fatal("dispatchCallback called with invalid id: %v", callbackID)
|
|
}
|
|
delete(mainThreadFunctionStore, callbackID)
|
|
mainThreadFunctionStoreLock.RUnlock()
|
|
fn()
|
|
}
|