Implement a locking model based on the current linux model - a tri-state mutex with active spinning, passive spinning and sleeping. R=golang-dev, dvyukov, rsc CC=golang-dev https://golang.org/cl/4974043