...

Text file src/runtime/testdata/testprogcgo/threadpanic_unix.c

Documentation: runtime/testdata/testprogcgo

     1// Copyright 2015 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.
     4
     5// +build !plan9,!windows
     6
     7#include <stdlib.h>
     8#include <stdio.h>
     9#include <pthread.h>
    10
    11void gopanic(void);
    12
    13static void*
    14die(void* x)
    15{
    16	gopanic();
    17	return 0;
    18}
    19
    20void
    21start(void)
    22{
    23	pthread_t t;
    24	if(pthread_create(&t, 0, die, 0) != 0)
    25		printf("pthread_create failed\n");
    26}

View as plain text