示例#1
0
void DviSubscription::Remove()
{
    iLock.Wait();
    DviService* service = iService;
    if (service != NULL) {
        service->AddRef();
    }
    iLock.Signal();
    if (service != NULL) {
        service->RemoveSubscription(iSid);
        service->RemoveRef();
    }
}
示例#2
0
DviService* DviDevice::ServiceReference(const ServiceType& aServiceType)
{
    DviService* service = NULL;
    iServiceLock.Wait();
    const Brx& fullNameUpnp = aServiceType.FullNameUpnp();
    const TUint count = (TUint)iServices.size();
    for (TUint i=0; i<count; i++) {
        DviService* s = iServices[i];
        if (s->ServiceType().FullNameUpnp() == fullNameUpnp) {
            s->AddRef();
            service = s;
            break;
        }
    }
    iServiceLock.Signal();
    return service;
}