huandu / go-tls

A bit safer approach to implement Thread Local Storage (TLS) for Go 1.7+.
MIT License
162 stars 15 forks source link

Fix random crash when gc is running and goroutine with hack is exiting #2

Closed huandu closed 6 years ago

huandu commented 6 years ago

The hackedGoexit pc value must be a position inside the method so that gc can correctly find out the top of a frame when this method is executing. It's required to implement this method in asm with the same technic used by runtime·goexit.