使用std :: thread进行线程处理时出错

时间:2016-11-18 01:53:08

标签: c++ multithreading

我是线程新手,完全不知道为什么会发生以下错误:

c:\program files (x86)\microsoft visual studio 14.0\vc\include\thr\xthread(240): error C2672: 'std::invoke': no matching overloaded function found

这是我创建线程的代码:

thread t1(testNextPasscode, 1, passcode, test, correct);
thread t2(testNextPasscode, 2, passcode, test, correct);
thread t3(testNextPasscode, 3, passcode, test, correct);
thread t4(testNextPasscode, 4, passcode, test, correct);
t1.join();
t2.join();
t3.join();
t4.join();

这是功能:

void testNextPasscode(int inc, string& passcode, string test, bool& correct) { ... }

似乎线程类中出现了问题,但我对此表示怀疑。发生了什么,我该如何解决?

0 个答案:

没有答案