Skip to content
Snippets Groups Projects
  • Roman Tsisyk's avatar
    250d031a
    Explicitly use thread-local buffer for C++ exceptions · 250d031a
    Roman Tsisyk authored
    This patch explicitly saves Exception to a thread-local variable inside
    struct cord on tnt_raise(). This variable can be used to safetly
    re-throw last exception from any place (not only from catch() block).
    This technique requires exception to be thrown and catched by pointers.
    tnt_raise macros was rewritten and all 'catch (Exception &)' blocks were
    substituted with 'catch (Exception *e)'.
    
    This patch also adds a new feature to box.raise() function.
    When called without arguments box.raise() re-throws last exception (if
    any).
    
    These changes needed to implement proper handlings of exception for FFI
    calls.
    250d031a
    History
    Explicitly use thread-local buffer for C++ exceptions
    Roman Tsisyk authored
    This patch explicitly saves Exception to a thread-local variable inside
    struct cord on tnt_raise(). This variable can be used to safetly
    re-throw last exception from any place (not only from catch() block).
    This technique requires exception to be thrown and catched by pointers.
    tnt_raise macros was rewritten and all 'catch (Exception &)' blocks were
    substituted with 'catch (Exception *e)'.
    
    This patch also adds a new feature to box.raise() function.
    When called without arguments box.raise() re-throws last exception (if
    any).
    
    These changes needed to implement proper handlings of exception for FFI
    calls.