-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
I had an issue, I havn't yet resolved or narrowed down.
Utilizing this function
@:pecan.accept static function sleep(ms, ?cb:Int->Void, ?co):Int {
trace("sleeping");
Timer.delay(function() {
trace("done sleeping");
cb(1);
}, ms);
return 0;
}Which compiled to
Stt.sleep = function(ms,cb,co) {
haxe_Log.trace("sleeping",{ fileName : "Stt.hx", lineNumber : 32, className : "Stt", methodName : "sleep"});
haxe_Timer.delay(function() {
haxe_Log.trace("done sleeping",{ fileName : "Stt.hx", lineNumber : 34, className : "Stt", methodName : "sleep"});
cb(1);
},ms);
return 0;
};Was running multiple times, when hooking in a debugger I found that cfgState was rewinded somehow to an earlier state, so when the callback is done it wwent back a step, I wasn't able to find anywhere in the code where it is modified.
In order to make the stacktrace smaller, I modified
,wakeupRet: function() {
if(!this.expecting) {
throw haxe_Exception.thrown("invalid state - can only return to Co in Expecting state");
}
this.expecting = false;
this.ready = true;
setTimeout(()=>{
this.tick();
},0);
}
Interesting that the original problem disapeared.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels