issue8517_windows.c 517 B

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