MCPcopy Create free account
hub / github.com/OpenZWave/open-zwave / CreateThread

Method CreateThread

cpp/test/src/gtest-port.cc:327–345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325class ThreadWithParamSupport : public ThreadWithParamBase {
326 public:
327 static HANDLE CreateThread(Runnable* runnable,
328 Notification* thread_can_start) {
329 ThreadMainParam* param = new ThreadMainParam(runnable, thread_can_start);
330 DWORD thread_id;
331 // TODO(yukawa): Consider to use _beginthreadex instead.
332 HANDLE thread_handle = ::CreateThread(
333 NULL, // Default security.
334 0, // Default stack size.
335 &ThreadWithParamSupport::ThreadMain,
336 param, // Parameter to ThreadMainStatic
337 0x0, // Default creation flags.
338 &thread_id); // Need a valid pointer for the call to work under Win98.
339 GTEST_CHECK_(thread_handle != NULL) << "CreateThread failed with error "
340 << ::GetLastError() << ".";
341 if (thread_handle == NULL) {
342 delete param;
343 }
344 return thread_handle;
345 }
346
347 private:
348 struct ThreadMainParam {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected