aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/YEngine/XMRInstRun.cs
diff options
context:
space:
mode:
authorUbitUmarov2018-03-09 21:33:39 +0000
committerUbitUmarov2018-03-09 21:33:39 +0000
commitc723a1be16307850055a9644f705f63f74df0c39 (patch)
treed2384aa7ade0f77a3bff00b749dd99f9a23f007e /OpenSim/Region/ScriptEngine/YEngine/XMRInstRun.cs
parentMerge branch 'master' into httptests (diff)
downloadopensim-SC-c723a1be16307850055a9644f705f63f74df0c39.zip
opensim-SC-c723a1be16307850055a9644f705f63f74df0c39.tar.gz
opensim-SC-c723a1be16307850055a9644f705f63f74df0c39.tar.bz2
opensim-SC-c723a1be16307850055a9644f705f63f74df0c39.tar.xz
Yengine temp file delete was still bad in case of script errors
Diffstat (limited to 'OpenSim/Region/ScriptEngine/YEngine/XMRInstRun.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/YEngine/XMRInstRun.cs25
1 files changed, 10 insertions, 15 deletions
diff --git a/OpenSim/Region/ScriptEngine/YEngine/XMRInstRun.cs b/OpenSim/Region/ScriptEngine/YEngine/XMRInstRun.cs
index 8ac9794..a52c4c8 100644
--- a/OpenSim/Region/ScriptEngine/YEngine/XMRInstRun.cs
+++ b/OpenSim/Region/ScriptEngine/YEngine/XMRInstRun.cs
@@ -399,8 +399,8 @@ namespace OpenSim.Region.ScriptEngine.Yengine
399 * Start event handler. 399 * Start event handler.
400 * 400 *
401 * Input: 401 * Input:
402 * eventCode = code of event to be processed 402 * newEventCode = code of event to be processed
403 * ehArgs = arguments for the event handler 403 * newEhArgs = arguments for the event handler
404 * 404 *
405 * Caution: 405 * Caution:
406 * It is up to the caller to make sure ehArgs[] is correct for 406 * It is up to the caller to make sure ehArgs[] is correct for
@@ -409,15 +409,15 @@ namespace OpenSim.Region.ScriptEngine.Yengine
409 * from ehArgs[] and will throw an array bounds or cast exception 409 * from ehArgs[] and will throw an array bounds or cast exception
410 * if it can't. 410 * if it can't.
411 */ 411 */
412 private Exception StartEventHandler(ScriptEventCode eventCode, object[] ehArgs) 412 private Exception StartEventHandler(ScriptEventCode newEventCode, object[] newEhArgs)
413 { 413 {
414 // We use this.eventCode == ScriptEventCode.None to indicate we are idle. 414 // We use this.eventCode == ScriptEventCode.None to indicate we are idle.
415 // So trying to execute ScriptEventCode.None might make a mess. 415 // So trying to execute ScriptEventCode.None might make a mess.
416 if(eventCode == ScriptEventCode.None) 416 if(newEventCode == ScriptEventCode.None)
417 return new Exception("Can't process ScriptEventCode.None"); 417 return new Exception("Can't process ScriptEventCode.None");
418 418
419 // Silly to even try if there is no handler defined for this event. 419 // Silly to even try if there is no handler defined for this event.
420 if(((int)eventCode >= 0) && (m_ObjCode.scriptEventHandlerTable[this.stateCode, (int)eventCode] == null)) 420 if(((int)newEventCode >= 0) && (m_ObjCode.scriptEventHandlerTable[this.stateCode, (int)newEventCode] == null))
421 return null; 421 return null;
422 422
423 // The microthread shouldn't be processing any event code. 423 // The microthread shouldn't be processing any event code.
@@ -427,8 +427,8 @@ namespace OpenSim.Region.ScriptEngine.Yengine
427 427
428 // Save eventCode so we know what event handler to run in the microthread. 428 // Save eventCode so we know what event handler to run in the microthread.
429 // And it also marks us busy so we can't be started again and this event lost. 429 // And it also marks us busy so we can't be started again and this event lost.
430 this.eventCode = eventCode; 430 this.eventCode = newEventCode;
431 this.ehArgs = ehArgs; 431 this.ehArgs = newEhArgs;
432 432
433 // This calls ScriptUThread.Main() directly, and returns when Main() [indirectly] 433 // This calls ScriptUThread.Main() directly, and returns when Main() [indirectly]
434 // calls Suspend() or when Main() returns, whichever occurs first. 434 // calls Suspend() or when Main() returns, whichever occurs first.
@@ -580,7 +580,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
580 */ 580 */
581 public void Reset() 581 public void Reset()
582 { 582 {
583 checkstate: 583 checkstate:
584 XMRInstState iState = m_IState; 584 XMRInstState iState = m_IState;
585 switch(iState) 585 switch(iState)
586 { 586 {
@@ -834,17 +834,12 @@ namespace OpenSim.Region.ScriptEngine.Yengine
834 834
835 switch(this.callMode) 835 switch(this.callMode)
836 { 836 {
837 // Now we are ready to suspend the microthread. 837 // Now we are ready to suspend or resume.
838 // This is like a longjmp() to the most recent StartEx() or ResumeEx()
839 // with a simultaneous setjmp() so ResumeEx() can longjmp() back here.
840
841 // the script event handler wants to hibernate
842 // capture stack frames and unwind to Start() or Resume()
843 case CallMode_NORMAL: 838 case CallMode_NORMAL:
844 m_CheckRunPhase = "suspending"; 839 m_CheckRunPhase = "suspending";
845 callMode = XMRInstance.CallMode_SAVE; 840 callMode = XMRInstance.CallMode_SAVE;
846 stackFrames = null; 841 stackFrames = null;
847 throw new StackHibernateException(); 842 throw new StackHibernateException(); // does not return
848 843
849 // We get here when the script state has been read in by MigrateInEventHandler(). 844 // We get here when the script state has been read in by MigrateInEventHandler().
850 // Since the stack is completely restored at this point, any subsequent calls 845 // Since the stack is completely restored at this point, any subsequent calls