Пример #1
0
void PeerSet::peerHas (Peer::ref ptr)
{
    boost::recursive_mutex::scoped_lock sl (mLock);

    if (!mPeers.insert (std::make_pair (ptr->getPeerId (), 0)).second)
        return;

    newPeer (ptr);
}
Пример #2
0
bool PeerSet::peerHas (Peer::ref ptr)
{
    ScopedLockType sl (mLock, __FILE__, __LINE__);

    if (!mPeers.insert (std::make_pair (ptr->getPeerId (), 0)).second)
        return false;

    newPeer (ptr);
    return true;
}
Пример #3
0
void PeerSet::badPeer (Peer::ref ptr)
{
    ScopedLockType sl (mLock, __FILE__, __LINE__);
    mPeers.erase (ptr->getPeerId ());
}
Пример #4
0
void PeerSet::badPeer (Peer::ref ptr)
{
    boost::recursive_mutex::scoped_lock sl (mLock);
    mPeers.erase (ptr->getPeerId ());
}