use ext_queue_sem for fsm datagram queue (instead of io_sem)
authorMartin Troxler <ch1010277@ch10pc446>
Thu, 16 Dec 2010 09:52:17 +0100
changeset 2019 63177d870116
parent 2018 6c05411fee9b
child 2020 47db5df5c7b3
use ext_queue_sem for fsm datagram queue (instead of io_sem)
master/master.c
--- a/master/master.c	Thu Dec 16 09:49:17 2010 +0100
+++ b/master/master.c	Thu Dec 16 09:52:17 2010 +0100
@@ -693,7 +693,9 @@
     ec_datagram_t *datagram, *n;
     size_t queue_size = 0;
 
+    down(&master->ext_queue_sem);
     if (list_empty(&master->fsm_datagram_queue)) {
+        up(&master->ext_queue_sem);
         return;
     }
     list_for_each_entry(datagram, &master->datagram_queue, queue) {
@@ -763,6 +765,7 @@
             }
         }
     }
+    up(&master->ext_queue_sem);
 }
 
 /*****************************************************************************/
@@ -805,14 +808,14 @@
 {
     ec_datagram_t *queued_datagram;
 
-    down(&master->io_sem);
+    down(&master->ext_queue_sem);
 
     // check, if the datagram is already queued
     list_for_each_entry(queued_datagram, &master->fsm_datagram_queue,
             queue) {
         if (queued_datagram == datagram) {
             datagram->state = EC_DATAGRAM_QUEUED;
-            up(&master->io_sem);
+            up(&master->ext_queue_sem);
             return;
         }
     }
@@ -829,7 +832,7 @@
 #endif
     datagram->jiffies_sent = jiffies;
 
-    up(&master->io_sem);
+    up(&master->ext_queue_sem);
 }
 
 /*****************************************************************************/