摘要: static void ManualResetEventFalseReset() { var signal = new ManualResetEvent(false); int x = 10; PrintLine(); new Thread(() => { PrintLine(); x++; Thr 阅读全文
posted @ 2024-03-09 20:55 FredGrit 阅读(8) 评论(0) 推荐(0)
摘要: class ThreadSafe { static readonly object _locker = new object(); static int _val1 = 1, _val2 = 1; static void Go() { lock(_locker) { if(_val2!=0) { C 阅读全文
posted @ 2024-03-09 17:28 FredGrit 阅读(43) 评论(0) 推荐(0)
摘要: [AttributeUsage(AttributeTargets.Method)] public sealed class TestAttribute:Attribute { public int Repetitions; public string FailureMessage; public T 阅读全文
posted @ 2024-03-09 14:21 FredGrit 阅读(13) 评论(0) 推荐(0)
摘要: static void Main(string[] args) { GenericMethod(); LogInfo(); } static void GenericMethod() { MethodInfo mi = typeof(Program).GetMethod("Echo"); Conso 阅读全文
posted @ 2024-03-09 12:33 FredGrit 阅读(137) 评论(0) 推荐(0)