mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-03 10:12:25 -06:00
better concurrency safety in Clear() and Done()
This commit is contained in:
parent
c6df3f610d
commit
db91fe5a94
2 changed files with 24 additions and 25 deletions
6
internal/cache/timeline/status.go
vendored
6
internal/cache/timeline/status.go
vendored
|
|
@ -196,14 +196,14 @@ func (t *StatusTimeline) Preload(
|
|||
n int,
|
||||
err error,
|
||||
) {
|
||||
t.preloader.CheckPreload(func() {
|
||||
t.preloader.CheckPreload(func(ptr *any) {
|
||||
n, err = t.preload(loadPage, filter)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
// Mark preloaded.
|
||||
t.preloader.Done()
|
||||
// Mark as preloaded.
|
||||
t.preloader.Done(ptr)
|
||||
})
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue