...

Text file src/cmd/cgo/internal/test/issue8517_windows.c

Documentation: cmd/cgo/internal/test

     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.
     4
     5#include "windows.h"
     6
     7extern void testHandleLeaksCallback();
     8
     9DWORD WINAPI testHandleLeaksFunc(LPVOID lpThreadParameter)
    10{
    11	int i;
    12	for(i = 0; i < 100; i++) {
    13		testHandleLeaksCallback();
    14	}
    15	return 0;
    16}
    17
    18void testHandleLeaks()
    19{
    20	HANDLE h;
    21	h = CreateThread(NULL, 0, &testHandleLeaksFunc, 0, 0, NULL);
    22	WaitForSingleObject(h, INFINITE);
    23	CloseHandle(h);
    24}

View as plain text