void JackClient::OnJackShutdown(void *o) { act("Audio Jack Shutdown"); m_Attached = false; // tells ssm to go back to non callback mode RunCallback(RunContext, false); return; }
void CRunTestsSheet::SubmitTests() { int nResources=m_bRemote?max(1,CTestResource::GetMatchCount (m_ep)):1; if(nResources>CeCosTest::InstanceCount){ if(m_nNextToSubmit>=executionpage.SelectedTestCount()){ return; } Info *pInfo=new Info; pInfo->pTest=new CeCosTest(m_ep, executionpage.SelectedTest(m_nNextToSubmit++)); pInfo->pSheet=this; m_nTestsToComplete++; if(m_bRemote){ CeCosThreadUtils::RunThread(RunRemoteFunc,pInfo,RunCallback,_T("RunRemoteFunc")); } else { bool bRun=false; switch((ResetType)m_nReset){ case RESET_NONE: bRun=true; break; case RESET_X10: // Resetting can take a while, so spawn a thread bRun=false; { DWORD dwID; CloseHandle(CreateThread(0,0,X10ThreadFunc, pInfo, 0, &dwID)); } break; case RESET_MANUAL: bRun=(IDOK==MessageBox(_T("Press OK when target is reset - cancel to abort run"),NULL,MB_OKCANCEL)); if(!bRun){ m_nNextToSubmit=executionpage.SelectedTestCount(); RunCallback(pInfo); } break; } if(bRun){ CeCosThreadUtils::RunThread(RunLocalFunc,pInfo,RunCallback,_T("RunLocalFunc")); } } } }
DWORD CRunTestsSheet::X10ThreadFunc (void *pParam) { Info *pInfo=(Info *)pParam; String str; bool bOk=false; CResetAttributes::ResetResult n=pInfo->pSheet->m_pResource->Reset(str); if(CResetAttributes::RESET_OK!=n){ str+=_T(">>> Could not reset target\n"); } str+=_TCHAR('\n'); LPTSTR pszCopy=new TCHAR[1+str.size()]; _tcscpy(pszCopy,str); pInfo->pSheet->PostMessage(WM_TESTOUTPUT,(WPARAM)pszCopy,0); if(bOk){ // we're already in a thread, so we can call the function directly pInfo->pTest->RunLocal(); } RunCallback(pInfo); return 0; }
void ecRunTestsDialog::SubmitTests() { int iTest; int nResources=wxGetApp().GetSettings().GetRunTestsSettings().m_bRemote ? wxMax(1,CTestResource::GetMatchCount (m_ep)):1; if(nResources>CeCosTest::InstanceCount){ if (m_nNextToSubmit >= m_executables->SelectedTestCount()){ m_runStatus = ecStopped; wxButton* runButton = (wxButton*) FindWindow(ecID_RUN_TESTS_RUN); runButton->SetLabel(_("&Run")); m_output->AddLogMsg(_("Run complete")); delete m_pResource; m_pResource=0; return; } ecRunTestsInfo *pInfo=new ecRunTestsInfo; pInfo->pTest=new CeCosTest(m_ep, m_executables->SelectedTest(m_nNextToSubmit++)); pInfo->pSheet=this; if(wxGetApp().GetSettings().GetRunTestsSettings().m_bRemote){ CeCosThreadUtils::RunThread(RunRemoteFunc,pInfo, (CeCosThreadUtils::CallbackProc*) RunCallback,_T("RunRemoteFunc")); } else { bool bRun=false; switch((ResetType)wxGetApp().GetSettings().GetRunTestsSettings().m_nReset){ case RESET_NONE: bRun=true; break; case RESET_X10: { // Resetting can take a while, so spawn a thread bRun=false; ecResetThread* thread = new ecResetThread(pInfo); if (thread->Create() != wxTHREAD_NO_ERROR) { // Thread will be deleted automatically when it has finished running thread->Run(); } else delete thread; break; } case RESET_MANUAL: { bRun=(wxOK == wxMessageBox(_("Press OK when target is reset - cancel to abort run"),_("Reset board"), wxOK|wxCANCEL)); if(!bRun) { m_nNextToSubmit = m_executables->SelectedTestCount(); RunCallback(pInfo); } break; } } if(bRun){ if (1 < m_nNextToSubmit) m_output->AddLogMsg(_("Run continuing")); CeCosThreadUtils::RunThread(RunLocalFunc, pInfo, (CeCosThreadUtils::CallbackProc*) RunCallback,_T("RunLocalFunc")); } } } }
void PromiseWorkerProxy::RejectedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue) { RunCallback(aCx, aValue, &Promise::MaybeReject); }