Support threads in the script debugger
* This implementation adds threads on the side of the client (script debugger). * Some functions of the debugger are optimized. * The profile is also now thread safe using atomics. * The editor can switch between multiple threads when debugging. This PR adds threaded support for the script language debugger. Every thread has its own thread local data and it will connect to the debugger using multiple thread IDs. This means that, now, the editor can receive multiple threads entering debug mode at the same time.
This commit is contained in:
@ -80,6 +80,17 @@ private:
|
||||
bool flushing = false;
|
||||
Thread::ID flush_thread = 0;
|
||||
|
||||
struct Message {
|
||||
String message;
|
||||
Array data;
|
||||
};
|
||||
|
||||
HashMap<Thread::ID, List<Message>> messages;
|
||||
|
||||
void _poll_messages();
|
||||
bool _has_messages();
|
||||
Array _get_message();
|
||||
|
||||
PrintHandlerList phl;
|
||||
static void _print_handler(void *p_this, const String &p_string, bool p_error, bool p_rich);
|
||||
ErrorHandlerList eh;
|
||||
|
||||
Reference in New Issue
Block a user