Index: gw/smsc/smsc_smpp.c
===================================================================
RCS file: /home/cvs/gateway/gw/smsc/smsc_smpp.c,v
retrieving revision 1.112
diff -u -w -r1.112 smsc_smpp.c
--- gw/smsc/smsc_smpp.c	29 Jan 2009 11:38:28 -0000	1.112
+++ gw/smsc/smsc_smpp.c	9 Feb 2009 06:21:00 -0000
@@ -153,6 +153,7 @@
     int transmit_port; 
     int receive_port; 
     int quitting; 
+    int throughput_sleeping;
     long enquire_link_interval;
     long max_pending_submits;
     int version;
@@ -247,6 +248,7 @@
     smpp->enquire_link_interval = enquire_link_interval;
     smpp->max_pending_submits = max_pending_submits; 
     smpp->quitting = 0; 
+    smpp->throughput_sleeping = 0;
     smpp->version = version;
     smpp->priority = priority;
     smpp->validityperiod = validity;
@@ -1030,8 +1032,11 @@
             /*
              * obey throughput speed limit, if any.
              */
-            if (smpp->conn->throughput > 0)
-                gwthread_sleep(delay);
+            if (smpp->conn->throughput > 0) {
+                smpp->throughput_sleeping = 1;
+                gwthread_sleep_micro(delay);
+                smpp->throughput_sleeping = 0;
+            }
         }
         else { /* write error occurs */
             smpp_pdu_destroy(pdu);
@@ -1951,7 +1956,14 @@
 
     smpp = conn->data;
     gw_prioqueue_produce(smpp->msgs_to_send, msg_duplicate(msg));
+    if(conn->throughput > 0) {
+        if(!smpp->throughput_sleeping) {
     gwthread_wakeup(smpp->transmitter);
+        }
+    } else {
+        gwthread_wakeup(smpp->transmitter);
+    }
+
     return 0;
 }
 
