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

     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  
    11  void gopanic(void);
    12  
    13  static void*
    14  die(void* x)
    15  {
    16  	gopanic();
    17  	return 0;
    18  }
    19  
    20  void
    21  start(void)
    22  {
    23  	pthread_t t;
    24  	if(pthread_create(&t, 0, die, 0) != 0)
    25  		printf("pthread_create failed\n");
    26  }
    27  

View as plain text