mirror of https://github.com/jetkvm/kvm.git
Finetuning: further perf. tunning
This commit is contained in:
parent
612dca3fca
commit
3158ca59f7
|
@ -2,6 +2,7 @@ package audio
|
|||
|
||||
import (
|
||||
"context"
|
||||
"runtime"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
@ -130,6 +131,10 @@ func (nam *NonBlockingAudioManager) StartAudioInput(receiveChan <-chan []byte) e
|
|||
|
||||
// outputWorkerThread handles all blocking audio output operations
|
||||
func (nam *NonBlockingAudioManager) outputWorkerThread() {
|
||||
// Lock to OS thread to isolate blocking CGO operations
|
||||
runtime.LockOSThread()
|
||||
defer runtime.UnlockOSThread()
|
||||
|
||||
defer nam.wg.Done()
|
||||
defer atomic.StoreInt32(&nam.outputWorkerRunning, 0)
|
||||
|
||||
|
@ -263,6 +268,10 @@ func (nam *NonBlockingAudioManager) outputCoordinatorThread() {
|
|||
|
||||
// inputWorkerThread handles all blocking audio input operations
|
||||
func (nam *NonBlockingAudioManager) inputWorkerThread() {
|
||||
// Lock to OS thread to isolate blocking CGO operations
|
||||
runtime.LockOSThread()
|
||||
defer runtime.UnlockOSThread()
|
||||
|
||||
defer nam.wg.Done()
|
||||
defer atomic.StoreInt32(&nam.inputWorkerRunning, 0)
|
||||
|
||||
|
|
Loading…
Reference in New Issue