1package cgo_pthread_flag 2 3/* 4#include <pthread.h> 5 6void* f(void* p) { 7 *(int*) p = 42; 8 return NULL; 9} 10 11int callFInBackground() { 12 int x; 13 pthread_t thread; 14 pthread_create(&thread, NULL, f, &x); 15 pthread_join(thread, NULL); 16 return x; 17} 18*/ 19import "C" 20 21// Wrapper for callFInBackground. We don't support using Cgo directly from 22// tests yet. 23func callFFromGo() int { 24 return int(C.callFInBackground()) 25} 26