* tree-vect-loop-manip.c (vect_do_peeling): Do not use
[official-gcc.git] / libgo / misc / cgo / test / issue6997_linux.c
blobde803d296e9ee61ef5d981d5cec1c86ec8c91390
1 // Copyright 2014 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 // +build !android
7 #include <pthread.h>
8 #include <stdio.h>
9 #include <unistd.h>
11 static pthread_t thread;
13 static void* threadfunc(void* dummy) {
14 while(1) {
15 sleep(1);
19 int StartThread() {
20 return pthread_create(&thread, NULL, &threadfunc, NULL);
23 int CancelThread() {
24 void *r;
25 pthread_cancel(thread);
26 pthread_join(thread, &r);
27 return (r == PTHREAD_CANCELED);