winlin

for bug #237, never sleep when thread interval is 0.

@@ -129,9 +129,9 @@ public: @@ -129,9 +129,9 @@ public:
129 }; 129 };
130 130
131 /** 131 /**
132 - * the publish recv thread got message and callback the source method to process message. 132 +* the publish recv thread got message and callback the source method to process message.
133 * @see: https://github.com/winlinvip/simple-rtmp-server/issues/237 133 * @see: https://github.com/winlinvip/simple-rtmp-server/issues/237
134 - */ 134 +*/
135 class SrsPublishRecvThread : public ISrsMessageHandler 135 class SrsPublishRecvThread : public ISrsMessageHandler
136 { 136 {
137 private: 137 private:
@@ -179,7 +179,11 @@ failed: @@ -179,7 +179,11 @@ failed:
179 break; 179 break;
180 } 180 }
181 181
182 - st_usleep(cycle_interval_us); 182 + // to improve performance, donot sleep when interval is zero.
  183 + // @see: https://github.com/winlinvip/simple-rtmp-server/issues/237
  184 + if (cycle_interval_us > 0) {
  185 + st_usleep(cycle_interval_us);
  186 + }
183 } 187 }
184 188
185 handler->on_thread_stop(); 189 handler->on_thread_stop();