Your testThread
is a static method, so it's available via type name. So, instead of using isntance threadTest
, use ThreadTest
type.
// public static void testThread()
testingThread = new Thread(new ThreadStart(ThreadTest.testThread));
Or change method declaration (remove static
):
// public void testThread()
testingThread = new Thread(new ThreadStart(threadTest.testThread));
Also you should pass method to delegate ThreadTest.testThread
(parentheses removed) instead of passing result of method invokation ThreadTest.testThread()
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…