/[svn]/linuxsampler/trunk/src/engines/EngineBase.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/EngineBase.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3207 by schoenebeck, Thu May 25 10:53:45 2017 UTC revision 3221 by schoenebeck, Fri May 26 18:30:42 2017 UTC
# Line 1304  namespace LinuxSampler { Line 1304  namespace LinuxSampler {
1304                              itScriptEvent->ignoreAllWaitCalls = false;                              itScriptEvent->ignoreAllWaitCalls = false;
1305                              itScriptEvent->handlerType = VM_EVENT_HANDLER_INIT;                              itScriptEvent->handlerType = VM_EVENT_HANDLER_INIT;
1306    
1307                              /*VMExecStatus_t res = */ pScriptVM->exec(                              VMExecStatus_t res;
1308                                  pEngineChannel->pScript->parserContext, &*itScriptEvent                              size_t instructionsCount = 0;
1309                              );                              const size_t maxInstructions = 200000; // aiming approx. 1 second max. (based on very roughly 5us / instruction)
1310                                bool bWarningShown = false;
1311                                do {
1312                                    res = pScriptVM->exec(
1313                                        pEngineChannel->pScript->parserContext, &*itScriptEvent
1314                                    );
1315                                    instructionsCount += itScriptEvent->execCtx->instructionsPerformed();
1316                                    if (instructionsCount > maxInstructions && !bWarningShown) {
1317                                        bWarningShown = true;
1318                                        dmsg(0,("[ScriptVM] WARNING: \"init\" event handler of instrument script executing for long time!\n"));
1319                                    }
1320                                } while (res & VM_EXEC_SUSPENDED && !(res & VM_EXEC_ERROR));
1321    
1322                              pEngineChannel->pScript->pEvents->free(itScriptEvent);                              pEngineChannel->pScript->pEvents->free(itScriptEvent);
1323                          }                          }

Legend:
Removed from v.3207  
changed lines
  Added in v.3221

  ViewVC Help
Powered by ViewVC