func create_thread(cb ThreadCallback) { _pid := new(C.pthread_t) log.Debug("> create_thread: %v", _pid) callbacks[_pid] = cb C.createThread(_pid) log.Debug("< create_thread: %v", _pid) }
// initializes a thread using pthread_create func Create(cb ThreadCallback, args interface{}) Thread { var pid C.pthread_t pidptr := &pid create_callback <- cb create_args <- args C.createThread(pidptr) return Thread(uintptr(unsafe.Pointer(&pid))) }
// initializes a thread using pthread_create func Create(cb ThreadCallback) Thread { var pid C.pthread_t pidptr := &pid create_callback <- cb C.createThread(pidptr) return Thread(uintptr(unsafe.Pointer(&pid))) }
func CreateThread(cb ThreadCallback, r *http.Request, w http.ResponseWriter) { _pid := new(C.pthread_t) callbacks.Add(_pid, cb, r, w) C.createThread(_pid) }
func CreateThread(function func()) { _pid := new(C.pthread_t) callbacks.Add(_pid, function) C.createThread(_pid) }