如何解决这个线程问题 [英] how to solve this threading problem
本文介绍了如何解决这个线程问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好亲爱的朋友..
线程th2 =新线程(新线程实现(this.check(int,Char,int) ,int)));
th2 .Priority = ThreadPriority.Highest;
th2.start();
错误CS0149:预期的方法名称
解决方案
您可以使用lambda表达式解决此问题:
线程th2 = new 线程(()= > 此 .check(yourInt1,yourChar,yourInt2,yourInt3));
th2.Priority = ThreadPriority.Highest;
th2.Start();
请注意,您应该在此处将变量名称作为参数,而不是它们的类型。
< BLOCKQUOTE>跨岗位。这在C#讨论中是开放的,所以请留在那里。
hello dear friends..
thread th2 = new Thread(new ThreadStart(this.check(int,Char,int, int)));
th2 .Priority = ThreadPriority.Highest;
th2.start();
Error CS0149 : Method name expected
解决方案
You can solve this by using a lambda expression:
Thread th2 = new Thread(() => this.check(yourInt1, yourChar, yourInt2, yourInt3)); th2.Priority = ThreadPriority.Highest; th2.Start();
Note that you should give the variable names as arguments here, not their type.
Cross-post. This is open in C# discussions, so please leave it there.
这篇关于如何解决这个线程问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文