pthread?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, may be this question is offtopic, sorry if this is the case, any way I'll 
appresiate if someone tell me where to find a good mailing list about Linux 
programming.

Any way, my problem is with the following test code:

typedef void*(*ftype)(void*);

void *thread_test( void *arg ){
     std::cout << "New Thread: " << *((int*)arg) << std::endl;
     delete arg;
}

int main(int argc, char *argv[]){
     
     ftype function = thread_test;
     for ( int i = 0; i < 10; i++ ){
          pthread_t thread_handler;
          int * _ni = new int;
          *_ni = i;
          int res = pthread_create( &thread_handler, NULL, function, _ni );
          std::cout << "Main Thread" << std::endl;
     }


     return EXIT_SUCCESS;
}

It compiles well, but when I run it, I get a signal 11, at debbug time I 
notice the signal is generated when the pthread_create is called. Any hint?, 
any linux-prog mailing list?

best reg@rds
-- 
Israel Fdez Cabrera.
Usuario Linux: 270292	(http://counter.li.org)
israel@xxxxxxxxxx
Segurmatica.
La Habana, Cuba.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux