[go: up one dir, main page]

Skip to content

Commit

Permalink
lock os thread when playing to improve the timing
Browse files Browse the repository at this point in the history
  • Loading branch information
metakeule committed Jul 30, 2024
1 parent 656e7c7 commit 03f2373
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions v2/smf/track.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package smf
import (
"fmt"
"io"
"runtime"
"sort"
"time"

Expand Down Expand Up @@ -245,6 +246,9 @@ func (t *TracksReader) MultiPlay(trackouts map[int]drivers.Out) error {

var last time.Duration = 0

runtime.LockOSThread()
defer runtime.UnlockOSThread()

for i := range pl {
last = t.play(last, pl[i])
}
Expand Down

0 comments on commit 03f2373

Please sign in to comment.