mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-04 15:42:25 +08:00
21 lines
331 B
Go
21 lines
331 B
Go
//go:build darwin
|
|
// +build darwin
|
|
|
|
package logger
|
|
|
|
/*
|
|
#include <pthread.h>
|
|
|
|
static unsigned long long thread_id() {
|
|
unsigned long long tid;
|
|
pthread_threadid_np(NULL, &tid);
|
|
return tid;
|
|
}
|
|
*/
|
|
import "C"
|
|
import "strconv"
|
|
|
|
func (l *Logger) getThreadId() (threadId string) {
|
|
return strconv.FormatUint(uint64(C.thread_id()), 10)
|
|
}
|