@@ -574,10 +574,10 @@ class ChannelImpl : public Watchable, public std::enable_shared_from_this<Channe
574574 }
575575
576576 /* *
577- * Signal the channel that a synchronous operation was completed.
578- * After this operation, waiting frames can be sent out.
577+ * Signal the channel that a synchronous operation was completed, and that any
578+ * queued frames can be sent out.
579579 */
580- void onSynchronized ();
580+ void flush ();
581581
582582 /* *
583583 * Report to the handler that the channel is opened
@@ -596,8 +596,8 @@ class ChannelImpl : public Watchable, public std::enable_shared_from_this<Channe
596596 // inform handler
597597 if (_readyCallback) _readyCallback ();
598598
599- // if the monitor is still valid, we exit synchronous mode now
600- if (monitor.valid ()) onSynchronized ();
599+ // if the monitor is still valid, we flush any waiting operations
600+ if (monitor.valid ()) flush ();
601601 }
602602
603603 /* *
@@ -644,10 +644,10 @@ class ChannelImpl : public Watchable, public std::enable_shared_from_this<Channe
644644 {
645645 // skip if there is no oldest callback
646646 if (!_oldestCallback) return true ;
647-
648- // the last (possibly synchronous) operation was received, so we're no longer in synchronous mode
649- if (_synchronous && _queue.empty ()) _synchronous = false ;
650647
648+ // flush the queue, which will send the next operation if the current operation was synchronous
649+ flush ();
650+
651651 // we are going to call callbacks that could destruct the channel
652652 Monitor monitor (this );
653653
0 commit comments