Standard library / runtime
runtime.UnlockOSThread()
Releases one thread-lock request made by the calling goroutine. Balance matching calls; no migration guarantee. Expected stdout: 'released\n'.
Formal Syntax & Structure
go syntaxgo
func UnlockOSThread()Working Example
Example Snippetgo
package main
import ( "fmt" "runtime")
func main() { runtime.LockOSThread(); runtime.UnlockOSThread(); fmt.Println("released") }