I'm trying to execute this code.
BOOL genFunctionOne(std::vector <char> functionOneBuffer, int functionOneCharCount)
{
int lineCountTest = 0;
int characterCountTest = 0;
for (int i = 0; i < functionOneCharCount; i++)
{
if (functionOneBuffer[i] == '\n')
lineCountTest++;
characterCountTest++;
}
return FALSE;
}
With this call.
std::thread funcThreadOne( [&] { functionOne = genFunctionOne( functionBufferOne, functionCharCountOne ); } );
And everytime I call the function. I get..
Microsoft Visual C++ Runtime Library
Debug Error!
Program:... my.exe
R6010
-abort() has been called
Please retry to debug the application.
The Break Point is cause by... crt0msg.c
if (rterrnum != _RT_CRNL && rterrnum != _RT_BANNER && rterrnum != _RT_CRT_NOTINIT)
{
switch (_CrtDbgReportW(_CRT_ERROR, NULL, 0, NULL, L"%s", error_text))
{
case 1: _CrtDbgBreak(); msgshown = 1; break;
case 0: msgshown = 1; break;
Thanks in advance.
I have actually tried to run other thread calls in the same program and have had no luck. It could be my compiler, are there any libraries that need to be linked in build options with #include ?
Do you join or detach the thread before exiting scope? Because you have to. Exiting scope with a thread running calls terminate.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With