/// <summary>
 /// 更新lurchtable,维护最新的deivcelist
 /// </summary>
 /// <param name="utoken"></param>
 /// <param name="tbase"></param>
 /// <returns></returns>
 public bool UpdateTokenLurchtable(string utoken, UserTokenMutability tbase)
 {
     if (_userTokenMutability_s.ContainsKey(utoken.ToString()))
     {
         return _userTokenMutability_s.TryUpdate(utoken.ToString(), tbase);
     }
     else
     {
         return _userTokenMutability_s.TryAdd(utoken.ToString(), tbase);
     }
 }
        public void TestUserTokenMutability()
        {
            //初始化第一层结构
            SingleUserTokenMutability stm = SingleUserTokenMutability.GetInstance();
            #if true
            //>1
            string utoken_1_mobile = "";
            string utoken_1_pc = "";
            #endif

            int i = 0;
            do
            {
                //建立一个用户token送入一个device类型的第二级结构内存
                UserTokenMutability ut_mobile = new UserTokenMutability("eccPK_mobile" + i, "userId" + i);
                UserDeviceMutability ud_mobile = DeivceSelected.GetDeivceInstance(DeviceType.Mobile);
                ud_mobile.UpdateTokenLurchtable(ut_mobile.Utoken, ut_mobile);
                stm.UpdateTokenLurchtable(DeviceType.Mobile, ud_mobile);

                //pc
                UserTokenMutability ut_pc = new UserTokenMutability("eccPK_pc" + i, "userId" + i);
                UserDeviceMutability ud_pc = DeivceSelected.GetDeivceInstance(DeviceType.PC);
                ud_pc.UpdateTokenLurchtable(ut_pc.Utoken, ut_pc);
                stm.UpdateTokenLurchtable(DeviceType.PC, ud_pc);

            #if true
                //>1 测试调用token时是否刷新了调用顺序 测试lru

                if (i == 1)
                {
                    utoken_1_mobile = ut_mobile.Utoken;
                }
                if (i == 3)
                {
                    utoken_1_pc = ut_pc.Utoken;
                }

                if (i > 3)
                {
                    Console.Write("get mobile uid = " + stm.GetUserTokenMutabilityFromLurchtable(DeviceType.Mobile).GetUidFromLurchtable(utoken_1_mobile));
                    Console.Write("get pc uid = " + stm.GetUserTokenMutabilityFromLurchtable(DeviceType.PC).GetUidFromLurchtable(utoken_1_pc));

                }
            #endif

                //循环变量
                i++;

            } while (i < 10);

            SingleUserTokenMutability _stm = stm;
        }