コード例 #1
0
        public void LogTimestamp(string id, ulong timestamp, string memo)
        {
            using (service_.mutex_)
            {
                if (service_.timestampList_.Count < 10000)
                {
                    Service.TimestampItem timestampItem = new Service.TimestampItem();
                    timestampItem.type      = Service.TimestampItemType.Log;
                    timestampItem.logger    = this;
                    timestampItem.id        = id;
                    timestampItem.timestamp = timestamp;
                    timestampItem.memo      = memo;

                    service_.timestampList_.Add(timestampItem);

                    service_.event_.Set();
                }
            }
        }
コード例 #2
0
        public void Dispose()
        {
            if (opened_)
            {
                opened_ = false;

                using (service_.mutex_)
                {
                    Service.TimestampItem timestampItem = new Service.TimestampItem();
                    timestampItem.type   = Service.TimestampItemType.Signal;
                    timestampItem.logger = this;

                    service_.timestampList_.Add(timestampItem);

                    service_.event_.Set();
                }

                event_.WaitOne();

                streamWriter_.Dispose();

                event_.Dispose();
            }
        }