示例#1
0
        public void WaitTest()
        {
            var thin = new ThinEvent();

            Task.Factory.StartNew(() => {
                Thread.Sleep(1000);
                thin.Set();

                if (IsDebugEnabled)
                {
                    log.Debug("Set event...");
                }
            });

            if (IsDebugEnabled)
            {
                log.Debug("Wait event set...");
            }

            thin.Wait();

            if (IsDebugEnabled)
            {
                log.Debug("set event is completed...");
            }
        }
示例#2
0
        public void WaitTest() {
            var thin = new ThinEvent();

            Task.Factory.StartNew(() => {
                                      Thread.Sleep(1000);
                                      thin.Set();

                                      if(IsDebugEnabled)
                                          log.Debug("Set event...");
                                  });

            if(IsDebugEnabled)
                log.Debug("Wait event set...");

            thin.Wait();

            if(IsDebugEnabled)
                log.Debug("set event is completed...");
        }