please try to execute -exec set scheduler-locking on at the gdb console in vscode.
-exec set scheduler-locking on
then the debugger will sticky to current thread.