Commit 25920689402718b3addfbb59a007c56a5107590d

Authored by dg
1 parent b9316861

fix


git-svn-id: http://svn.net-core.org/repos/t-engine4@2633 51575b47-30f0-44d4-a5cc-537603b46e54
Showing 1 changed file with 7 additions and 7 deletions
... ... @@ -849,7 +849,7 @@ void create_particles_thread()
849 849 printf("Destroying particle thread %d\n", i);
850 850 sem_res = SDL_SemPost(pt->keyframes);
851 851 if (sem_res) printf("Error while waiting for particle thread to die: %s\n", SDL_GetError());
852   - printf("Destroying particle thread %d (waiting for thread)\n", i);
  852 + printf("Destroying particle thread %d (waiting for thread %x)\n", i, (int)pt->thread);
853 853 SDL_WaitThread(pt->thread, &status);
854 854 printf("Destroyed particle thread %d (%d)\n", i, status);
855 855 }
... ... @@ -864,6 +864,12 @@ void create_particles_thread()
864 864 for (i = 0; i < MAX_THREADS; i++)
865 865 {
866 866 SDL_Thread *thread;
  867 + thread = SDL_CreateThread(thread_particles, pt);
  868 + if (thread == NULL) {
  869 + printf("Unable to create particle thread: %s\n", SDL_GetError());
  870 + continue;
  871 + }
  872 +
867 873 particle_thread *pt = &threads[i];
868 874
869 875 pt->thread = thread;
... ... @@ -873,12 +879,6 @@ void create_particles_thread()
873 879 pt->keyframes = SDL_CreateSemaphore(0);
874 880 pt->running = TRUE;
875 881
876   - thread = SDL_CreateThread(thread_particles, pt);
877   - if (thread == NULL) {
878   - printf("Unable to create particle thread: %s\n", SDL_GetError());
879   - continue;
880   - }
881   -
882 882 printf("Creating particles thread %d\n", pt->id);
883 883 }
884 884 }
... ...