[dahdi-commits] fjoe: freebsd/trunk r7835 - /freebsd/trunk/drivers/dahdi/dahdi_dynamic.c

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Sun Jan 10 14:54:48 CST 2010


Author: fjoe
Date: Sun Jan 10 14:54:44 2010
New Revision: 7835

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=7835
Log:
- Call timer function without timer spinlock held
- Take timer spinlock when calling callout_reset

Modified:
    freebsd/trunk/drivers/dahdi/dahdi_dynamic.c

Modified: freebsd/trunk/drivers/dahdi/dahdi_dynamic.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/dahdi_dynamic.c?view=diff&rev=7835&r1=7834&r2=7835
==============================================================================
--- freebsd/trunk/drivers/dahdi/dahdi_dynamic.c (original)
+++ freebsd/trunk/drivers/dahdi/dahdi_dynamic.c Sun Jan 10 14:54:44 2010
@@ -140,6 +140,7 @@
 run_timer(void *arg)
 {
 	struct timer_list *t = (struct timer_list *) arg;
+	void (*function)(unsigned long);
 
 	mtx_lock_spin(&t->mtx);
 	if (callout_pending(&t->callout)) {
@@ -154,8 +155,10 @@
 	}
 	callout_deactivate(&t->callout);
 
-	t->function(t->data);
+	function = t->function;
 	mtx_unlock_spin(&t->mtx);
+
+	function(t->data);
 }
 
 static void
@@ -171,7 +174,9 @@
 static void
 mod_timer(struct timer_list *t, unsigned long expires)
 {
+	mtx_lock_spin(&t->mtx);
 	callout_reset(&t->callout, expires - jiffies, run_timer, t);
+	mtx_unlock_spin(&t->mtx);
 }
 
 static void




More information about the dahdi-commits mailing list