Open zjgg888 opened 2 years ago
I haven't tested the scenario you posted here.
Here are my thoughts for your reference. The current implementation is the internal lock is held by the execution thread because that thread doesn't know it is paused. That internal lock prevents other threads from executing anything including the V8 inspector. That design might be wrong.
Could you leave your minimal reproduceable code snippet and your expected result?
Sorry,it's hard to take code snippet from my project. Also, I used to dispatch inspector message in J2V8 is in 'waitFrontendMessageOnPause' callback,this callback gives a chance to do something when script paused.
That would make it hard for me to troubleshoot. Do you mind joining the discord server to discuss with me in detail? I still need a code snippet.
I think this issue is not merely on Android but on all operating systems. There seems to be a flaw in the locking mechanism. I think Javet needs to detect a break point hit event and release the lock accordingly. It's a considerable change which requires a certain amount of dev time.
It's been so long. I just submitted a fix to the dev branch. Do you mind taking a try? The snapshot build is at Actions.
Execute a script and pause it by setbreakpoint using V8Inspector before (executing script in thread1), when the script is paused, use V8Inspector.sendRequest('Debugger.resume') to resume execution (resume script in thread2), it blocked at v8Native.v8InspectorSend(v8Runtime.getHandle(), message);