コード例 #1
0
ファイル: SenderImpl.cpp プロジェクト: KeithLatteri/awips2
void SenderImpl::waitForCapacity() 
{
    //TODO: add option to throw exception rather than blocking?
    if (capacity <= (flushed ? checkPendingSends(false) : outgoing.size())) {
        //Initial implementation is very basic. As outgoing is
        //currently only reduced on receiving completions and we are
        //blocking anyway we may as well sync(). If successful that
        //should clear all outstanding sends.
        session.sync();
        checkPendingSends(false);
    }
    //flush periodically and check for conmpleted sends
    if (++window > (capacity / 4)) {//TODO: make this configurable?
        checkPendingSends(true);
        window = 0;
    }
}
コード例 #2
0
ファイル: SenderImpl.cpp プロジェクト: bbcarchdev/qpid-cpp
uint32_t SenderImpl::checkPendingSends(bool flush) {
    sys::Mutex::ScopedLock l(lock);
    return checkPendingSends(flush, l);
}