--- jack/engine.h.orig	2009-11-17 14:35:58.000000000 +0100
+++ jack/engine.h	2010-07-22 04:17:06.000000000 +0200
@@ -187,9 +187,9 @@
 extern jack_client_internal_t *
 jack_client_internal_by_id (jack_engine_t *engine, jack_client_id_t id);
 
-#define jack_rdlock_graph(e) { DEBUG ("acquiring graph read lock"); if (pthread_rwlock_rdlock (&e->client_lock)) abort(); }
-#define jack_lock_graph(e) { DEBUG ("acquiring graph write lock"); if (pthread_rwlock_wrlock (&e->client_lock)) abort(); }
-#define jack_try_rdlock_graph(e) pthread_rwlock_tryrdlock (&e->client_lock)
+#define jack_rdlock_graph(e) { DEBUG ("acquiring graph read lock"); e->watchdog_check = 1; if (pthread_rwlock_rdlock (&e->client_lock)) abort(); }
+#define jack_lock_graph(e) { DEBUG ("acquiring graph write lock"); e->watchdog_check = 1; if (pthread_rwlock_wrlock (&e->client_lock)) abort(); }
+#define jack_try_rdlock_graph(e) ((e->watchdog_check = 1), pthread_rwlock_tryrdlock (&e->client_lock))
 #define jack_unlock_graph(e) { DEBUG ("release graph lock"); if (pthread_rwlock_unlock (&e->client_lock)) abort(); }
 
 #define jack_trylock_problems(e) pthread_mutex_trylock (&e->problem_lock)
--- jackd/engine.c.orig	2009-11-17 14:35:58.000000000 +0100
+++ jackd/engine.c	2010-07-23 00:52:15.000000000 +0200
@@ -2074,6 +2074,7 @@
 	   to exit.
 	*/
 
+	engine->watchdog_check = 1;
 	engine->freewheeling = 0;
 	VERBOSE (engine, "freewheeling stopped, waiting for thread");
 	pthread_join (engine->freewheel_thread, &ftstatus);
