I have written a simple code to test threading
in C++11
. But I can't run it in Clion IDE
, it gives following error in red lines.
terminate called after throwing an instance of 'std::system_error'
what(): Enable multithreading to use std::thread: Operation not permitted
Process finishes with exit code 134
.
some details about my system :
- linux ubuntu 14.10
- C++11
I guess the code is not that important to solve this problem, but I am pasting it here:
#include <iostream>
#include <thread>
using namespace std;
void task1 () {
cout << "Task 1::"<<endl;
}
int main() {
thread t1(task1);
t1.join();
return 0;
}