Files
go-xmlsec/thread_darwin.go
2016-12-04 13:32:12 +00:00

15 lines
328 B
Go

package xmlsec
import "unsafe"
// #include <pthread.h>
import "C"
// getThreadID returns an opaque value that is unique per OS thread.
func getThreadID() uintptr {
// Darwin lacks a meaningful version of gettid() so instead we use
// ptread_self() as a proxy.
// #nosec
return uintptr(unsafe.Pointer(C.pthread_self()))
}