Start task.
527 {
528#if _WIN32||_WIN64
529 unsigned thread_id;
530#if __TBB_WIN8UI_SUPPORT
531 std::thread* thread_tmp = new std::thread(thread_function, this);
532 thread_handle = thread_tmp->native_handle();
533 thread_id = 0;
534#else
535 unsigned stack_size = 0;
536#if HARNESS_THREAD_STACK_SIZE
537 stack_size = HARNESS_THREAD_STACK_SIZE;
538#endif
539 thread_handle = (HANDLE)_beginthreadex(NULL, stack_size, thread_function, this, 0, &thread_id);
540#endif
541 ASSERT(thread_handle != 0,
"NativeParallelFor: _beginthreadex failed");
542#else
543#if __ICC==1100
544#pragma warning (push)
545#pragma warning (disable: 2193)
546#endif
547
548
549
550
551#if !defined(HARNESS_THREAD_STACK_SIZE)
552#if __i386__||__i386||__arm__
553 const size_t stack_size = 1 *
MByte;
554#elif __x86_64__
555 const size_t stack_size = 2 *
MByte;
556#else
557 const size_t stack_size = 4 *
MByte;
558#endif
559#else
560 const size_t stack_size = HARNESS_THREAD_STACK_SIZE;
561#endif
562 pthread_attr_t attr_stack;
563 int status = pthread_attr_init(&attr_stack);
564 ASSERT(0 == status,
"NativeParallelFor: pthread_attr_init failed");
565 status = pthread_attr_setstacksize(&attr_stack, stack_size);
566 ASSERT(0 == status,
"NativeParallelFor: pthread_attr_setstacksize failed");
567 status = pthread_create(&thread_id, &attr_stack, thread_function, this);
568 ASSERT(0 == status,
"NativeParallelFor: pthread_create failed");
569 pthread_attr_destroy(&attr_stack);
570#if __ICC==1100
571#pragma warning (pop)
572#endif
573#endif
574 }
#define ASSERT(p, message)