예제 #1
0
        internal override ReturnCode AttachToWaitSet(WaitSet waitset)
        {
            ReturnCode result = DDS.ReturnCode.AlreadyDeleted;

            ReportStack.Start();
            lock (this)
            {
                if (this.rlReq_isAlive)
                {
                    if (!waitSetList.Contains(waitset))
                    {
                        result = waitset.wlReq_AttachGuardCondition(this);
                        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);
        }
        internal override ReturnCode AttachToWaitSet(WaitSet waitset)
        {
            ReturnCode result = DDS.ReturnCode.AlreadyDeleted;

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

            return(result);
        }