void scriptMarkStack(hx::MarkContext *__inCtx) { MyMutex *m = sCppiaCtxLock; if (m) m->Lock(); for(int i=0;i<sAllContexts.size();i++) sAllContexts[i]->mark(__inCtx); if (m) m->Unlock(); }
Dynamic __hxcpp_thread_create(Dynamic inStart) { g_threadInfoMutex.Lock(); int threadNumber = g_nextThreadNumber++; g_threadInfoMutex.Unlock(); hxThreadInfo *info = new hxThreadInfo(inStart, threadNumber); hx::GCPrepareMultiThreaded(); hx::EnterGCFreeZone(); #if defined(HX_WINRT) try { auto workItemHandler = ref new WorkItemHandler([=](IAsyncAction^) { // Run the user callback. hxThreadFunc(info); }, Platform::CallbackContext::Any); ThreadPool::RunAsync(workItemHandler, WorkItemPriority::Normal, WorkItemOptions::None); }