Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 06.2.md #1161

Merged
merged 1 commit into from
Mar 4, 2021
Merged

Update 06.2.md #1161

merged 1 commit into from
Mar 4, 2021

Conversation

lv0senku
Copy link
Contributor

@lv0senku lv0senku commented Mar 2, 2021

fix session销毁的*Manager#GC()直接执行

// testcase
package main

import (
	"fmt"
	"sync"
	"time"
)

func main() {
	foo := &Foo{}

	go foo.CheckTimeout()
	for {
		fmt.Print(".")
		time.Sleep(1 * time.Second)
	}
}

type Foo struct {
	mu sync.Mutex
}

func (f *Foo) CheckTimeout() {
	f.mu.Lock()
	defer f.mu.Unlock()
	fmt.Println("timeout")
	time.AfterFunc(10000 * time.Second, func() {
		f.CheckTimeout()
	})
}

fix session销毁的*Manager#GC()直接执行
@astaxie astaxie merged commit 027b4ad into astaxie:master Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants