示例#1
0
 private AMCLooper(Thread t)
 {
     if (t.Equals(Thread.CurrentThread))
     {
         if (_locals.IsValueCreated)
         {
             throw new ArgumentException("another AMCLooper has been attached to the thread " + t);
         }
     }
     _thread = t;
 }
示例#2
0
 public void Awake()
 {
     lock (_lock)
     {
         if (_instance == null)
         {
             _instance = this;
             if (_mainThread == null || !_mainThread.Equals(Thread.CurrentThread))
             {
                 _mainThread = Thread.CurrentThread;
             }
             AmazonHookedPlatformInfo.Instance.Init();
             Object.DontDestroyOnLoad(this);
             TraceListener listener = new UnityDebugTraceListener("UnityDebug");
             AWSConfigs.AddTraceListener("Amazon", listener);
             _instance.get_gameObject().AddComponent <UnityMainThreadDispatcher>();
         }
         else if (this != _instance)
         {
             Object.DestroyObject(this);
         }
     }
 }
示例#3
0
        public MFTestResults Threading_CurrentThread_Test24()
        {
            /// <summary>
            /// 1. Start a thread
            /// 2. Verify Thread.CurrentThread gives the thread itself
            /// </summary>
            /// 

            MFTestResults testResult = MFTestResults.Pass;
            Log.Comment("Starting the Thread");
            Work w = new Work();
            w.m_data = 7;
            Thread newThread1 = new Thread(w.DoMoreWork);
            newThread1.Start();
            Thread.Sleep(1);
            Log.Comment("verifying Thread.CurrentThread gives the Thread itself");
            if (!newThread1.Equals(w.currThread))
            {
                Log.Comment("Comparing the Thread with its own (Thread.Equals(Thread.CurrentThread)) failed");
                testResult = MFTestResults.Fail;
            }
            return testResult;
        }
示例#4
0
 private bool Equals(ThreadNode other)
 {
     return(thread.Equals(other.thread));
 }