Ejemplo n.º 1
0
        internal virtual ReturnCode AttachToWaitSet(WaitSet waitset)
        {
            ReturnCode result = DDS.ReturnCode.AlreadyDeleted;

            lock (this)
            {
                if (this.rlReq_isAlive)
                {
                    if (!waitSetList.Contains(waitset))
                    {
                        result = waitset.wlReq_AttachGeneralCondition(this, rlReq_UserPeer, rlReq_HandleSelf);
                        if (result == DDS.ReturnCode.Ok)
                        {
                            /* The waitset will detach itself when it is destructed. */
                            waitSetList.Add(waitset);
                        }
                    }
                    else
                    {
                        result = DDS.ReturnCode.Ok;
                    }
                }
            }

            return(result);
        }
Ejemplo n.º 2
0
        internal virtual ReturnCode AttachToWaitSet(WaitSet waitset)
        {
            ReturnCode result = DDS.ReturnCode.AlreadyDeleted;

            lock (this)
            {
                if (this.rlReq_isAlive)
                {
                    if (!waitSetList.Contains(waitset))
                    {
                        result = waitset.wlReq_AttachGeneralCondition(this, rlReq_UserPeer, rlReq_HandleSelf);
                        if (result == DDS.ReturnCode.Ok)
                        {
                            /* The waitset will detach itself when it is destructed. */
                            waitSetList.Add(waitset);
                        }
                    }
                    else
                    {
                        result = DDS.ReturnCode.Ok;
                    }
                }
            }

//            if (result != DDS.ReturnCode.Ok) {
//                OS_REPORT(OS_ERROR,
//                            "Condition::attach_waitset", 0,
//                            "attach failed with %s",
//                            DDS::OpenSplice::Utils::returnCodeToString(result));
//            }

            return(result);
        }