mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 01:20:42 +00:00
For a block invoke to another thread, safe and restore
* In future we could handle async exceptions by storing the exception information in a std::function derived object (instead of the separate ExceptionHandling that lives on the stack) and query it out in a new WaitForInvoke function maybe. Right now we just print the exception to the output log and abort the callback.
This commit is contained in:
@@ -829,3 +829,18 @@ extern "C" void HandleException(PyObject *global_handle)
|
||||
if(redirector->context)
|
||||
emit redirector->context->exception(typeStr, valueStr, frames);
|
||||
}
|
||||
|
||||
extern "C" bool IsThreadBlocking(PyObject *global_handle)
|
||||
{
|
||||
OutputRedirector *redirector = (OutputRedirector *)global_handle;
|
||||
if(redirector && redirector->context)
|
||||
return redirector->context->threadBlocking();
|
||||
return false;
|
||||
}
|
||||
|
||||
extern "C" void SetThreadBlocking(PyObject *global_handle, bool block)
|
||||
{
|
||||
OutputRedirector *redirector = (OutputRedirector *)global_handle;
|
||||
if(redirector && redirector->context)
|
||||
return redirector->context->setThreadBlocking(block);
|
||||
}
|
||||
Reference in New Issue
Block a user