func (t Thread) Exec(wait bool, fn func()) {
	if !wait {
		t <- fn
		return
	}
	var wg sync.WaitGroup
	wg.Add(1)
	t <- func() {
		fn()
		wg.Done()
	}
	wg.Wait()
}
Exec sends new job to the Thread. If wait is true this function
blocks until job finishes execution.
package lcore
import (
	"runtime"
	"sync"
	"golang.org/x/sys/unix"
)
type Thread chan<- func()
func NewLockedThread(ch chan func()) Thread {
	go func() {
		runtime.LockOSThread()
		for f := range ch {
			f()
		}
		runtime.UnlockOSThread()
	}()
	return ch
}