| 637 | } |
| 638 | |
| 639 | void new_thread_invoke ( Lambda lambda, Func fn, int32_t lambdaSize, Context * context, LineInfoArg * lineinfo ) { |
| 640 | shared_ptr<Context> forkContext; |
| 641 | forkContext.reset(get_clone_context(context, uint32_t(ContextCategory::thread_clone))); |
| 642 | forkContext->sharedPtrContext = true; |
| 643 | auto ptr = forkContext->allocate(lambdaSize + 16,lineinfo); |
| 644 | forkContext->heap->mark_comment(ptr, "new [[ ]] in new_thread"); |
| 645 | memset ( ptr, 0, lambdaSize + 16 ); |
| 646 | ptr += 16; |
| 647 | das_invoke_function<void>::invoke(forkContext.get(), lineinfo, fn, ptr, lambda.capture); |
| 648 | das_delete<Lambda>::clear(context, lambda); |
| 649 | g_jobQueTotalThreads ++; |
| 650 | auto bound = daScriptEnvironment::getBound(); |
| 651 | thread([=]() mutable { |
| 652 | daScriptEnvironment::setBound(bound); |
| 653 | Lambda flambda(ptr); |
| 654 | das_invoke_lambda<void>::invoke(forkContext.get(), lineinfo, flambda); |
| 655 | das_delete<Lambda>::clear(forkContext.get(), flambda); |
| 656 | g_jobQueTotalThreads --; |
| 657 | shutdownThreadLocalDebugAgent(); |
| 658 | }).detach(); |
| 659 | } |
| 660 | |
| 661 | extern condition_variable debugger_stopped; |
| 662 | extern atomic<bool> debugger_started; |
nothing calls this directly
no test coverage detected