Displaying 1 result from an estimated 1 matches for "pthread_attr_setscope".
2009 Mar 08
3
Thread creation in Wine
...ed int k=0; k < CNT; k++)
for(unsigned int i=0; i<CNT; i++)
mysum += i;
std::cout << "mysum: " << mysum << std::endl;
return 0;
}
int main(int argc, char *argv[]) {
pthread_t pthread_id, pthread_id2;
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setscope(&attr, PTHREAD_SCOPE_PROCESS);
std::cout << "first thread: " << pthread_create(&pthread_id, &attr, my_th, 0) << std::endl;
std::cout << "second thread: " << pthread_create(&pthread_id2, &attr, my_th, 0) << std::endl;
pth...