Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 26th, 2012  |  syntax: None  |  size: 0.47 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Seg fault after calling destructor successfully or calling empy destructor. C  
  2. ParallelSynthesizer* p = new ParallelSynthesizer(argc, argv);
  3. p->synthesize();
  4. delete p;
  5. cout << "after deleting" << endl;
  6.        
  7. pthread_t threads[num_threads];
  8. // makes the "params" array here. skipped.
  9. for (int i=0; i<num_threads; i++) {
  10.     pthread_create(&threads[i], NULL, synthesizeThreadMethod, (void*)(params[i]));
  11. }
  12.  
  13. for (int i=0; i<num_threads; i++) {
  14.     pthread_join(threads[i], NULL);;
  15. }