diff --git a/ChangeLog b/ChangeLog index 4d94ad74..7f7ac9b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -27,6 +27,10 @@ Josh Green Jackdmp changes log --------------------------- +2009-12-09 Stephane Letz + + * When threads are cancelled, the exception has to be rethrown. + 2009-12-08 Stephane Letz * Josh Green ALSA driver capture only patch. diff --git a/common/JackLockedEngine.h b/common/JackLockedEngine.h index c2de8512..1b22d607 100644 --- a/common/JackLockedEngine.h +++ b/common/JackLockedEngine.h @@ -31,6 +31,16 @@ namespace Jack #define TRY_CALL \ try { \ +/* +See : http://groups.google.com/group/comp.programming.threads/browse_thread/thread/652bcf186fbbf697/f63757846514e5e5 + +catch (...) { + // Assuming thread cancellation, must rethrow + throw; + +} +*/ + #define CATCH_EXCEPTION_RETURN \ } catch(std::bad_alloc& e) { \ jack_error("Memory allocation error..."); \ @@ -41,7 +51,7 @@ namespace Jack return -1; \ } catch (...) { \ jack_error("Unknown error..."); \ - return -1; \ + throw; \ } \ #define CATCH_ENGINE_EXCEPTION \ @@ -49,6 +59,7 @@ namespace Jack jack_error("Memory allocation error..."); \ } catch (...) { \ jack_error("Unknown error..."); \ + throw; \ } \ /*! diff --git a/tests/test.cpp b/tests/test.cpp index 9477d731..b5d2467e 100644 --- a/tests/test.cpp +++ b/tests/test.cpp @@ -185,6 +185,7 @@ int Jack_Port_Rename_Callback(jack_port_id_t port, const char* old_name, const c { Log("Rename callback has been successfully called with old_name '%s' and new_name '%s'. (msg from callback)\n"); port_rename_clbk = 1; + return 0; } int Jack_Update_Buffer_Size(jack_nframes_t nframes, void *arg)