Skip to content

Commit

Permalink
feat: export the internal package sync
Browse files Browse the repository at this point in the history
  • Loading branch information
panjf2000 committed Jan 12, 2025
1 parent 4acc969 commit 343e4c2
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 6 deletions.
13 changes: 11 additions & 2 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ autolabeler:
title:
- /fix/i
- /bug/i
- /patch/i
- /resolve/i
- label: docs
files:
- '*.md'
Expand All @@ -60,6 +60,15 @@ autolabeler:
- /update/i
- /remove/i
- /delete/i
- label: optimization
title:
- /opt:/i
- /refactor/i
- /optimize/i
- /improve/i
- /update/i
- /remove/i
- /delete/i
- label: new feature
title:
- /feat:/i
Expand All @@ -75,7 +84,7 @@ autolabeler:
- label: chores
title:
- /chore/i
- /\bmisc\b/i
- /misc/i
- /cleanup/i
- /clean up/i
- label: major
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
run: go test -v -race -coverprofile="codecov.report" -covermode=atomic

- name: Upload code coverage report to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
file: ./codecov.report
flags: unittests
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<a title="Release" target="_blank" href="https://github.com/panjf2000/ants/releases"><img src="https://img.shields.io/github/v/release/panjf2000/ants.svg?color=161823&style=flat-square&logo=smartthings" /></a>
<a title="Tag" target="_blank" href="https://github.com/panjf2000/ants/tags"><img src="https://img.shields.io/github/v/tag/panjf2000/ants?color=%23ff8936&logo=fitbit&style=flat-square" /></a>
<br/>
<a title="Minimum Go Version" target="_blank" href="https://github.com/panjf2000/gnet"><img src="https://img.shields.io/badge/go-%3E%3D1.16-30dff3?style=flat-square&logo=go" /></a>
<a title="Go Report Card" target="_blank" href="https://goreportcard.com/report/github.com/panjf2000/ants"><img src="https://goreportcard.com/badge/github.com/panjf2000/ants?style=flat-square" /></a>
<a title="Doc for ants" target="_blank" href="https://pkg.go.dev/github.com/panjf2000/ants/v2?tab=doc"><img src="https://img.shields.io/badge/go.dev-doc-007d9c?style=flat-square&logo=read-the-docs" /></a>
<a title="Mentioned in Awesome Go" target="_blank" href="https://github.com/avelino/awesome-go#goroutines"><img src="https://awesome.re/mentioned-badge-flat.svg" /></a>
Expand Down
1 change: 1 addition & 0 deletions README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<a title="Release" target="_blank" href="https://github.com/panjf2000/ants/releases"><img src="https://img.shields.io/github/v/release/panjf2000/ants.svg?color=161823&style=flat-square&logo=smartthings" /></a>
<a title="Tag" target="_blank" href="https://github.com/panjf2000/ants/tags"><img src="https://img.shields.io/github/v/tag/panjf2000/ants?color=%23ff8936&logo=fitbit&style=flat-square" /></a>
<br/>
<a title="Minimum Go Version" target="_blank" href="https://github.com/panjf2000/gnet"><img src="https://img.shields.io/badge/go-%3E%3D1.16-30dff3?style=flat-square&logo=go" /></a>
<a title="Go Report Card" target="_blank" href="https://goreportcard.com/report/github.com/panjf2000/ants"><img src="https://goreportcard.com/badge/github.com/panjf2000/ants?style=flat-square" /></a>
<a title="Doc for ants" target="_blank" href="https://pkg.go.dev/github.com/panjf2000/ants/v2?tab=doc"><img src="https://img.shields.io/badge/go.dev-doc-007d9c?style=flat-square&logo=read-the-docs" /></a>
<a title="Mentioned in Awesome Go" target="_blank" href="https://github.com/avelino/awesome-go#goroutines"><img src="https://awesome.re/mentioned-badge-flat.svg" /></a>
Expand Down
2 changes: 1 addition & 1 deletion pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"sync/atomic"
"time"

syncx "github.com/panjf2000/ants/v2/internal/sync"
syncx "github.com/panjf2000/ants/v2/sync"
)

type poolCommon struct {
Expand Down
2 changes: 1 addition & 1 deletion pool_func.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"sync/atomic"
"time"

syncx "github.com/panjf2000/ants/v2/internal/sync"
syncx "github.com/panjf2000/ants/v2/sync"
)

// PoolWithFunc accepts the tasks and process them concurrently,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion internal/sync/spinlock_test.go → sync/spinlock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
Benchmark result for three types of locks:
goos: darwin
goarch: arm64
pkg: github.com/panjf2000/ants/v2/internal/sync
pkg: github.com/panjf2000/ants/v2/sync
BenchmarkMutex-10 10452573 111.1 ns/op 0 B/op 0 allocs/op
BenchmarkSpinLock-10 58953211 18.01 ns/op 0 B/op 0 allocs/op
BenchmarkBackOffSpinLock-10 100000000 10.81 ns/op 0 B/op 0 allocs/op
Expand Down

0 comments on commit 343e4c2

Please sign in to comment.