feat(无损保存): 优化原生无损保存
build.yaml / build (push) Successful in 2m24s

This commit is contained in:
xiaoqidun committed 2026-10-18 00:16:22 +08:00
1 parent 331e26b71e
commit 16b09e52e4
5 files changed
+194 -33

No files matched your search

+4
View File
@@ -31,6 +31,7 @@ import (
"slices"
"strconv"
"strings"
"sync"
"time"
"github.com/xiaoqidun/ofdgo"
@@ -406,6 +407,7 @@ type annotationOptions struct {
// outputContext 定期让出浏览器线程,将取消请求传入库层长操作
type outputContext struct {
context.Context
mu sync.Mutex
cancel context.CancelFunc
checkpoint func() error
checked time.Time
@@ -7250,6 +7252,8 @@ func (c *outputContext) Err() error {
if err := c.Context.Err(); err != nil {
return err
}
c.mu.Lock()
defer c.mu.Unlock()
if c.pending != 0 {
c.pending--
return nil