当前位置: 首页>>代码示例>>C#>>正文


C# ReaderWriterLockSlim.ExitUpgradeableReadLock方法代码示例

本文整理汇总了C#中System.Threading.ReaderWriterLockSlim.ExitUpgradeableReadLock方法的典型用法代码示例。如果您正苦于以下问题:C# ReaderWriterLockSlim.ExitUpgradeableReadLock方法的具体用法?C# ReaderWriterLockSlim.ExitUpgradeableReadLock怎么用?C# ReaderWriterLockSlim.ExitUpgradeableReadLock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Threading.ReaderWriterLockSlim的用法示例。


在下文中一共展示了ReaderWriterLockSlim.ExitUpgradeableReadLock方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PacketReceiver

        internal PacketReceiver(string LocalAddress) : base (LocalAddress)
        {
            packetReceiver = new Queue();
            tokenSource = new CancellationTokenSource();
            readerWriterLock = new ReaderWriterLockSlim();

            tokenSource.Token.Register(() => { 
                // Clear on cancel
                packetReceiver.Clear(); 
            });


            var thReceiveQueue = Task.Factory.StartNew(() => {
                while (tokenSource.Token.IsCancellationRequested == false)
                {
                    readerWriterLock.EnterUpgradeableReadLock();
                    if (packetReceiver.Count > 0)
                    {
                        readerWriterLock.EnterWriteLock();

                        byte[] data = (byte[])packetReceiver.Dequeue();

                        readerWriterLock.ExitWriteLock();

                        if (OnNewPacketReceived != null)
                            OnNewPacketReceived(this, new NewPacketEventArgs(data));
                    }

                    readerWriterLock.ExitUpgradeableReadLock();
                }
            });

        }
开发者ID:jasper22,项目名称:UbuntuUsbMonitor,代码行数:33,代码来源:PacketReceiver.cs

示例2: EnterExit

        public static void EnterExit()
        {
            using (ReaderWriterLockSlim rwls = new ReaderWriterLockSlim())
            {
                Assert.False(rwls.IsReadLockHeld);
                rwls.EnterReadLock();
                Assert.True(rwls.IsReadLockHeld);
                rwls.ExitReadLock();
                Assert.False(rwls.IsReadLockHeld);

                Assert.False(rwls.IsUpgradeableReadLockHeld);
                rwls.EnterUpgradeableReadLock();
                Assert.True(rwls.IsUpgradeableReadLockHeld);
                rwls.ExitUpgradeableReadLock();
                Assert.False(rwls.IsUpgradeableReadLockHeld);

                Assert.False(rwls.IsWriteLockHeld);
                rwls.EnterWriteLock();
                Assert.True(rwls.IsWriteLockHeld);
                rwls.ExitWriteLock();
                Assert.False(rwls.IsWriteLockHeld);

                Assert.False(rwls.IsUpgradeableReadLockHeld);
                rwls.EnterUpgradeableReadLock();
                Assert.False(rwls.IsWriteLockHeld);
                Assert.True(rwls.IsUpgradeableReadLockHeld);
                rwls.EnterWriteLock();
                Assert.True(rwls.IsWriteLockHeld);
                rwls.ExitWriteLock();
                Assert.False(rwls.IsWriteLockHeld);
                Assert.True(rwls.IsUpgradeableReadLockHeld);
                rwls.ExitUpgradeableReadLock();
                Assert.False(rwls.IsUpgradeableReadLockHeld);

                Assert.True(rwls.TryEnterReadLock(0));
                rwls.ExitReadLock();

                Assert.True(rwls.TryEnterReadLock(Timeout.InfiniteTimeSpan));
                rwls.ExitReadLock();

                Assert.True(rwls.TryEnterUpgradeableReadLock(0));
                rwls.ExitUpgradeableReadLock();

                Assert.True(rwls.TryEnterUpgradeableReadLock(Timeout.InfiniteTimeSpan));
                rwls.ExitUpgradeableReadLock();

                Assert.True(rwls.TryEnterWriteLock(0));
                rwls.ExitWriteLock();

                Assert.True(rwls.TryEnterWriteLock(Timeout.InfiniteTimeSpan));
                rwls.ExitWriteLock();
            }
        }
开发者ID:ESgarbi,项目名称:corefx,代码行数:53,代码来源:ReaderWriterLockSlimTests.cs

示例3: RecursiveWriteUpgradeTest

        public void RecursiveWriteUpgradeTest()
        {
            ReaderWriterLockSlim rwlock = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);

            rwlock.EnterWriteLock();
            Assert.IsTrue(rwlock.IsWriteLockHeld);
            rwlock.EnterUpgradeableReadLock();
            Assert.IsTrue(rwlock.IsUpgradeableReadLockHeld);
            rwlock.ExitUpgradeableReadLock();
            Assert.IsFalse(rwlock.IsUpgradeableReadLockHeld);
            Assert.IsTrue(rwlock.IsWriteLockHeld);
            rwlock.ExitWriteLock();
            Assert.IsFalse(rwlock.IsWriteLockHeld);
            rwlock.EnterWriteLock();
            Assert.IsTrue(rwlock.IsWriteLockHeld);
        }
开发者ID:mesheets,项目名称:Theraot-CF,代码行数:16,代码来源:ReaderWriterLockSlimTest.cs

示例4: RecursiveEnterExitUpgradableTest

        public void RecursiveEnterExitUpgradableTest()
        {
            var v = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);

            v.EnterUpgradeableReadLock();
            v.EnterUpgradeableReadLock();
            v.EnterUpgradeableReadLock();

            Assert.IsTrue(v.IsUpgradeableReadLockHeld);
            Assert.AreEqual(3, v.RecursiveUpgradeCount);

            v.ExitUpgradeableReadLock();

            Assert.IsTrue(v.IsUpgradeableReadLockHeld);
            Assert.AreEqual(2, v.RecursiveUpgradeCount);
        }
开发者ID:mesheets,项目名称:Theraot-CF,代码行数:16,代码来源:ReaderWriterLockSlimTest.cs

示例5: DontReleaseWaitingReadersWhenThereAreWaitingWriters

        public static void DontReleaseWaitingReadersWhenThereAreWaitingWriters()
        {
            using(var rwls = new ReaderWriterLockSlim())
            {
                rwls.EnterUpgradeableReadLock();
                rwls.EnterWriteLock();
                // Typical order of execution: 0

                // Add a waiting writer
                var threads = new Thread[2];
                using(var beforeEnterWriteLock = new ManualResetEvent(false))
                {
                    var thread =
                        new Thread(() =>
                        {
                            beforeEnterWriteLock.Set();
                            rwls.EnterWriteLock();
                            // Typical order of execution: 3
                            rwls.ExitWriteLock();
                        });
                    thread.IsBackground = true;
                    thread.Start();
                    threads[0] = thread;
                    beforeEnterWriteLock.WaitOne();
                }

                // Add a waiting reader
                using(var beforeEnterReadLock = new ManualResetEvent(false))
                {
                    var thread =
                        new Thread(() =>
                        {
                            beforeEnterReadLock.Set();
                            rwls.EnterReadLock();
                            // Typical order of execution: 4
                            rwls.ExitReadLock();
                        });
                    thread.IsBackground = true;
                    thread.Start();
                    threads[1] = thread;
                    beforeEnterReadLock.WaitOne();
                }

                // Wait for the background threads to block waiting for their locks
                Thread.Sleep(1000);

                // Typical order of execution: 1
                rwls.ExitWriteLock();
                // At this point there is still one reader and one waiting writer, so the reader-writer lock should not try to
                // release any of the threads waiting for a lock

                // Typical order of execution: 2
                rwls.ExitUpgradeableReadLock();
                // At this point, the waiting writer should be released, and the waiting reader should not

                foreach(var thread in threads)
                    thread.Join();
                // Typical order of execution: 5
            }
        }
开发者ID:ESgarbi,项目名称:corefx,代码行数:60,代码来源:ReaderWriterLockSlimTests.cs

示例6: WriterToUpgradeableReaderChain

 public static void WriterToUpgradeableReaderChain()
 {
     using (AutoResetEvent are = new AutoResetEvent(false))
     using (ReaderWriterLockSlim rwls = new ReaderWriterLockSlim())
     {
         rwls.EnterWriteLock();
         Task t = Task.Factory.StartNew(() =>
         {
             Assert.False(rwls.TryEnterUpgradeableReadLock(TimeSpan.FromMilliseconds(10)));
             Task.Run(() => are.Set()); // ideally this won't fire until we've called EnterReadLock, but it's a benign race in that the test will succeed either way
             rwls.EnterUpgradeableReadLock();
             rwls.ExitUpgradeableReadLock();
         }, CancellationToken.None, TaskCreationOptions.LongRunning, TaskScheduler.Default);
         are.WaitOne();
         rwls.ExitWriteLock();
         t.GetAwaiter().GetResult();
     }
 }
开发者ID:ESgarbi,项目名称:corefx,代码行数:18,代码来源:ReaderWriterLockSlimTests.cs

示例7: InvalidExits

        public static void InvalidExits(LockRecursionPolicy policy)
        {
            using (ReaderWriterLockSlim rwls = new ReaderWriterLockSlim(policy))
            {
                Assert.Throws<SynchronizationLockException>(() => rwls.ExitReadLock());
                Assert.Throws<SynchronizationLockException>(() => rwls.ExitUpgradeableReadLock());
                Assert.Throws<SynchronizationLockException>(() => rwls.ExitWriteLock());

                rwls.EnterReadLock();
                Assert.Throws<SynchronizationLockException>(() => rwls.ExitUpgradeableReadLock());
                Assert.Throws<SynchronizationLockException>(() => rwls.ExitWriteLock());
                rwls.ExitReadLock();

                rwls.EnterUpgradeableReadLock();
                Assert.Throws<SynchronizationLockException>(() => rwls.ExitReadLock());
                Assert.Throws<SynchronizationLockException>(() => rwls.ExitWriteLock());
                rwls.ExitUpgradeableReadLock();

                rwls.EnterWriteLock();
                Assert.Throws<SynchronizationLockException>(() => rwls.ExitReadLock());
                Assert.Throws<SynchronizationLockException>(() => rwls.ExitUpgradeableReadLock());
                rwls.ExitWriteLock();

                using (Barrier barrier = new Barrier(2))
                {
                    Task t = Task.Factory.StartNew(() =>
                    {
                        rwls.EnterWriteLock();
                        barrier.SignalAndWait();
                        barrier.SignalAndWait();
                        rwls.ExitWriteLock();
                    }, CancellationToken.None, TaskCreationOptions.LongRunning, TaskScheduler.Default);

                    barrier.SignalAndWait();
                    Assert.Throws<SynchronizationLockException>(() => rwls.ExitWriteLock());
                    barrier.SignalAndWait();

                    t.GetAwaiter().GetResult();
                }
            }
        }
开发者ID:ESgarbi,项目名称:corefx,代码行数:41,代码来源:ReaderWriterLockSlimTests.cs

示例8: LoadSingleFactoryData

 //- $LoadSingleFactoryData -//
 private static void LoadSingleFactoryData(WebDomainData data, String factoryType, Object[] parameterArray, Map parameterMap, String source)
 {
     var readerWriterLockSlim = new ReaderWriterLockSlim();
     try
     {
         IFactory factory = null;
         //+
         readerWriterLockSlim.EnterUpgradeableReadLock();
         if (!RouteCache.HandlerFactoryCache.ContainsKey(factoryType) && !RouteCache.ProcessorFactoryCache.ContainsKey(factoryType))
         {
             readerWriterLockSlim.EnterWriteLock();
             //+
             try
             {
                 if (!RouteCache.HandlerFactoryCache.ContainsKey(factoryType) && !RouteCache.ProcessorFactoryCache.ContainsKey(factoryType))
                 {
                     factory = ObjectCreator.CreateAs<IFactory>(factoryType);
                     if (factory == null)
                     {
                         throw new InvalidFactoryException(String.Format(Resource.Factory_Invalid, factoryType));
                     }
                     //+
                     FactoryData factoryData = FactoryData.Create(factoryType, parameterArray, parameterMap);
                     factoryData.Source = String.IsNullOrEmpty(source) ? Info.System : source;
                     if (factory is HandlerFactory)
                     {
                         data.HandlerFactoryDataList.Add(factoryData);
                         RouteCache.HandlerFactoryCache.Add(factoryType, factory);
                     }
                     else if (factory is ProcessorFactory)
                     {
                         data.ProcessorFactoryDataList.Add(factoryData);
                         RouteCache.ProcessorFactoryCache.Add(factoryType, factory);
                     }
                 }
             }
             finally
             {
                 readerWriterLockSlim.ExitWriteLock();
             }
         }
     }
     catch (Exception ex)
     {
         if (WebProcessingReportController.Reporter.Initialized)
         {
             var map = new Map();
             map.Add("Section", "Factory");
             map.Add("Type", factoryType);
             map.Add("Message", ex.Message);
             map.Add("Exception Type", ex.GetType().FullName);
             //+
             WebProcessingReportController.Reporter.AddMap(map);
         }
     }
     finally
     {
         readerWriterLockSlim.ExitUpgradeableReadLock();
     }
 }
开发者ID:davidbetz,项目名称:themelia,代码行数:61,代码来源:ConfigurationLoader.cs

示例9: EnterWriteLockWhileInUpgradeAndOtherWaiting

		public void EnterWriteLockWhileInUpgradeAndOtherWaiting ()
		{
			var v = new ReaderWriterLockSlim ();

			var task2 = new Task(() => {
                v.EnterWriteLock();
                v.ExitWriteLock();
            });

            var task1 = new Task(() =>
            {
                v.EnterUpgradeableReadLock ();
                task2.Start ();
                Thread.Sleep (100);
                v.EnterWriteLock ();
                v.ExitWriteLock ();
                v.ExitUpgradeableReadLock ();
            });
            task1.Start ();

            Assert.IsTrue (task1.Wait (500));
		}
开发者ID:Profit0004,项目名称:mono,代码行数:22,代码来源:ReaderWriterLockSlimTest.cs

示例10: ReleaseReadLock

 public static void ReleaseReadLock(ReaderWriterLockSlim locks)
 {
     if (locks.IsUpgradeableReadLockHeld)
         locks.ExitUpgradeableReadLock();
 }
开发者ID:NatalieWojciechowski,项目名称:Space394,代码行数:5,代码来源:ThreadLock.cs

示例11: ExitWriteLock

 private void ExitWriteLock(ReaderWriterLockSlim detectorLock)
 {
     detectorLock.ExitWriteLock();
     detectorLock.EnterReadLock();
     detectorLock.ExitUpgradeableReadLock();
     detectorLock.ExitReadLock();
 }
开发者ID:Hanjun-Dai,项目名称:DuplicationDetector,代码行数:7,代码来源:Detector.cs

示例12: Foo3

        private void Foo3()
        {
            var concurentDictionary = new Dictionary<int, int>();
            var rwLockSlim = new ReaderWriterLockSlim();

            var w = new ManualResetEvent(false);
            int timedCalled = 0;
            var threads = new List<Thread>();
            int j;
            Lazy<int> lazy = new Lazy<int>(() => { Interlocked.Increment(ref timedCalled); return 1; });
            for (int i = 0; i < Environment.ProcessorCount; i++)
            {
                threads.Add(new Thread(() =>
                {
                    w.WaitOne();
                    rwLockSlim.EnterUpgradeableReadLock();
                    try
                    {
                        if (!concurentDictionary.TryGetValue(1, out j))
                        {
                            rwLockSlim.EnterWriteLock();
                            try
                            {
                                Interlocked.Increment(ref timedCalled);
                                concurentDictionary[1] = 1;
                            }
                            finally
                            {
                                rwLockSlim.ExitWriteLock();
                            }
                        }
                    }
                    finally
                    {
                        rwLockSlim.ExitUpgradeableReadLock();

                    }
                }));

                threads.Last().Start();
            }

            w.Set();//release all threads to start at the same time
            Thread.Sleep(100);
            Console.WriteLine(timedCalled);// output is 1
        }
开发者ID:HK-Zhang,项目名称:Grains,代码行数:46,代码来源:ThreadSafeDicDemo.cs

示例13: LoadSingleProcessorData


//.........这里部分代码省略.........
                 //+
                 try
                 {
                     if (!RouteCache.ProcessorCache.ContainsKey(processorType))
                     {
                         processor = ProcessorActivator.Create<IProcessor>(processorType, RouteCache.ProcessorFactoryCache);
                         if (processor == null)
                         {
                             throw new InvalidProcessorException(String.Format(Resource.Processor_Invalid, processorType));
                         }
                         //+
                         RouteCache.ProcessorCache.Add(processorType, processor);
                     }
                 }
                 finally
                 {
                     readerWriterLockSlim.ExitWriteLock();
                 }
             }
             if (processor == null)
             {
                 return;
             }
             ProcessorData processorData;
             if (processor is InitProcessor)
             {
                 processorData = new ProcessorData
                                 {
                                     ProcessorType = processorType, ParameterArray = parameterArray
                                 };
                 processorData.Source = String.IsNullOrEmpty(source) ? Info.System : source;
                 data.InitProcessorDataList.Add(processorData);
             }
             else if (processor is SelectionProcessor)
             {
                 processorData = new ProcessorData
                                 {
                                     ProcessorType = processorType, ParameterArray = parameterArray
                                 };
                 processorData.Source = String.IsNullOrEmpty(source) ? Info.System : source;
                 data.SelectionProcessorDataList.Add(processorData);
             }
             else if (processor is OverrideProcessor)
             {
                 processorData = new ProcessorData
                                 {
                                     ProcessorType = processorType, ParameterArray = parameterArray
                                 };
                 processorData.Source = String.IsNullOrEmpty(source) ? Info.System : source;
                 data.OverrideProcessorDataList.Add(processorData);
             }
             else if (processor is StateProcessor)
             {
                 processorData = new ProcessorData
                                 {
                                     ProcessorType = processorType, ParameterArray = parameterArray
                                 };
                 processorData.Source = String.IsNullOrEmpty(source) ? Info.System : source;
                 data.StateProcessorDataList.Add(processorData);
             }
             else if (processor is PostRenderProcessor)
             {
                 processorData = new ProcessorData
                                 {
                                     ProcessorType = processorType, ParameterArray = parameterArray
                                 };
                 processorData.Source = String.IsNullOrEmpty(source) ? Info.System : source;
                 data.PostRenderProcessorDataList.Add(processorData);
             }
             else if (processor is ErrorProcessor)
             {
                 processorData = new ErrorProcessorData
                                 {
                                     ProcessorType = processorType, ParameterArray = parameterArray
                                 };
                 processorData.Source = String.IsNullOrEmpty(source) ? Info.System : source;
                 var epd = ((ErrorProcessorData)processorData);
                 epd.Init();
                 data.ErrorProcessorDataList.Add(epd);
             }
         }
         finally
         {
             readerWriterLockSlim.ExitUpgradeableReadLock();
         }
     }
     catch (Exception ex)
     {
         if (WebProcessingReportController.Reporter.Initialized)
         {
             var map = new Map();
             map.Add("Section", "Processor");
             map.Add("Type", processorType);
             map.Add("Message", ex.Message);
             map.Add("Exception Type", ex.GetType().FullName);
             //+
             WebProcessingReportController.Reporter.AddMap(map);
         }
     }
 }
开发者ID:davidbetz,项目名称:themelia,代码行数:101,代码来源:ConfigurationLoader.cs

示例14: EnterUpgradeableReadLock

		public void EnterUpgradeableReadLock ()
		{
			var v = new ReaderWriterLockSlim ();

			v.EnterUpgradeableReadLock ();
			Assert.IsTrue (v.IsUpgradeableReadLockHeld, "A");
			Assert.AreEqual (0, v.RecursiveWriteCount, "A1");
			Assert.AreEqual (0, v.RecursiveReadCount, "A2");
			Assert.AreEqual (1, v.RecursiveUpgradeCount, "A3");
			Assert.AreEqual (0, v.WaitingReadCount, "A4");
			Assert.AreEqual (0, v.WaitingUpgradeCount, "A5");
			Assert.AreEqual (0, v.WaitingWriteCount, "A6");
			v.ExitUpgradeableReadLock ();

			v.EnterUpgradeableReadLock ();
			Assert.IsTrue (v.IsUpgradeableReadLockHeld, "B");
			Assert.AreEqual (0, v.RecursiveWriteCount, "B1");
			Assert.AreEqual (0, v.RecursiveReadCount, "B2");
			Assert.AreEqual (1, v.RecursiveUpgradeCount, "B3");
			Assert.AreEqual (0, v.WaitingReadCount, "B4");
			Assert.AreEqual (0, v.WaitingUpgradeCount, "B5");
			Assert.AreEqual (0, v.WaitingWriteCount, "B6");

			v.EnterReadLock ();
			v.ExitUpgradeableReadLock ();

			Assert.IsTrue (v.IsReadLockHeld, "C");
			Assert.AreEqual (0, v.RecursiveWriteCount, "C1");
			Assert.AreEqual (1, v.RecursiveReadCount, "C2");
			Assert.AreEqual (0, v.RecursiveUpgradeCount, "C3");
			Assert.AreEqual (0, v.WaitingReadCount, "C4");
			Assert.AreEqual (0, v.WaitingUpgradeCount, "C5");
			Assert.AreEqual (0, v.WaitingWriteCount, "C6");

			v.ExitReadLock ();
		}
开发者ID:cthrax,项目名称:mono,代码行数:36,代码来源:ReaderWriterLockSlimTest.cs

示例15: DeadlockAvoidance

        public static void DeadlockAvoidance()
        {
            using (ReaderWriterLockSlim rwls = new ReaderWriterLockSlim())
            {
                rwls.EnterReadLock();
                Assert.Throws<LockRecursionException>(() => rwls.EnterReadLock());
                Assert.Throws<LockRecursionException>(() => rwls.EnterUpgradeableReadLock());
                Assert.Throws<LockRecursionException>(() => rwls.EnterWriteLock());
                rwls.ExitReadLock();

                rwls.EnterUpgradeableReadLock();
                rwls.EnterReadLock();
                Assert.Throws<LockRecursionException>(() => rwls.EnterReadLock());
                rwls.ExitReadLock();
                Assert.Throws<LockRecursionException>(() => rwls.EnterUpgradeableReadLock());
                rwls.EnterWriteLock();
                Assert.Throws<LockRecursionException>(() => rwls.EnterWriteLock());
                rwls.ExitWriteLock();
                rwls.ExitUpgradeableReadLock();

                rwls.EnterWriteLock();
                Assert.Throws<LockRecursionException>(() => rwls.EnterReadLock());
                Assert.Throws<LockRecursionException>(() => rwls.EnterUpgradeableReadLock());
                Assert.Throws<LockRecursionException>(() => rwls.EnterWriteLock());
                rwls.ExitWriteLock();
            }

            using (ReaderWriterLockSlim rwls = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion))
            {
                rwls.EnterReadLock();
                Assert.Throws<LockRecursionException>(() => rwls.EnterWriteLock());
                rwls.EnterReadLock();
                Assert.Throws<LockRecursionException>(() => rwls.EnterUpgradeableReadLock());
                rwls.ExitReadLock();
                rwls.ExitReadLock();

                rwls.EnterUpgradeableReadLock();
                rwls.EnterReadLock();
                rwls.EnterUpgradeableReadLock();
                rwls.ExitUpgradeableReadLock();
                rwls.EnterReadLock();
                rwls.ExitReadLock();
                rwls.ExitReadLock();
                rwls.EnterWriteLock();
                rwls.EnterWriteLock();
                rwls.ExitWriteLock();
                rwls.ExitWriteLock();
                rwls.ExitUpgradeableReadLock();

                rwls.EnterWriteLock();
                rwls.EnterReadLock();
                rwls.ExitReadLock();
                rwls.EnterUpgradeableReadLock();
                rwls.ExitUpgradeableReadLock();
                rwls.EnterWriteLock();
                rwls.ExitWriteLock();
                rwls.ExitWriteLock();
            }
        }
开发者ID:ESgarbi,项目名称:corefx,代码行数:59,代码来源:ReaderWriterLockSlimTests.cs


注:本文中的System.Threading.ReaderWriterLockSlim.ExitUpgradeableReadLock方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。