test/testatomic.c
changeset 5969 3a041d215edc
parent 5535 96594ac5fd1a
child 6977 b73d51026c68
     1.1 --- a/test/testatomic.c	Tue Sep 27 23:16:04 2011 -0400
     1.2 +++ b/test/testatomic.c	Sun Oct 02 00:29:16 2011 -0400
     1.3 @@ -143,7 +143,7 @@
     1.4      SDL_AtomicSet(&threadsRunning, NThreads);
     1.5  
     1.6      while (T--)
     1.7 -        SDL_CreateThread(adder, NULL);
     1.8 +        SDL_CreateThread(adder, "Adder", NULL);
     1.9   
    1.10      while (SDL_AtomicGet(&threadsRunning) > 0)
    1.11          SDL_SemWait(threadDone);
    1.12 @@ -618,7 +618,7 @@
    1.13  #ifdef TEST_SPINLOCK_FIFO
    1.14      /* Start a monitoring thread */
    1.15      if (lock_free) {
    1.16 -        SDL_CreateThread(FIFO_Watcher, &queue);
    1.17 +        SDL_CreateThread(FIFO_Watcher, "FIFOWatcher", &queue);
    1.18      }
    1.19  #endif
    1.20  
    1.21 @@ -627,9 +627,11 @@
    1.22      SDL_zero(readerData);
    1.23      SDL_AtomicSet(&readersRunning, NUM_READERS);
    1.24      for (i = 0; i < NUM_READERS; ++i) {
    1.25 +        char name[64];
    1.26 +        SDL_snprintf(name, sizeof (name), "FIFOReader%d", i);
    1.27          readerData[i].queue = &queue;
    1.28          readerData[i].lock_free = lock_free;
    1.29 -        SDL_CreateThread(FIFO_Reader, &readerData[i]);
    1.30 +        SDL_CreateThread(FIFO_Reader, name, &readerData[i]);
    1.31      }
    1.32  
    1.33      /* Start up the writers */
    1.34 @@ -637,10 +639,12 @@
    1.35      SDL_zero(writerData);
    1.36      SDL_AtomicSet(&writersRunning, NUM_WRITERS);
    1.37      for (i = 0; i < NUM_WRITERS; ++i) {
    1.38 +        char name[64];
    1.39 +        SDL_snprintf(name, sizeof (name), "FIFOWriter%d", i);
    1.40          writerData[i].queue = &queue;
    1.41          writerData[i].index = i;
    1.42          writerData[i].lock_free = lock_free;
    1.43 -        SDL_CreateThread(FIFO_Writer, &writerData[i]);
    1.44 +        SDL_CreateThread(FIFO_Writer, name, &writerData[i]);
    1.45      }
    1.46   
    1.47      /* Wait for the writers */