1 // Copyright 2013 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 #define WIN32_LEAN_AND_MEAN
8 #include "_cgo_export.h"
23 doAdd(int max
, int nthread
)
25 enum { MaxThread
= 20 };
27 uintptr_t thread_id
[MaxThread
];
29 if(nthread
> MaxThread
)
31 for(i
=0; i
<nthread
; i
++)
32 thread_id
[i
] = _beginthreadex(0, 0, addThread
, &max
, 0, 0);
33 for(i
=0; i
<nthread
; i
++) {
34 WaitForSingleObject((HANDLE
)thread_id
[i
], INFINITE
);
35 CloseHandle((HANDLE
)thread_id
[i
]);