Changes between Initial Version and Version 1 of Ticket #44062, comment 60


Ignore:
Timestamp:
Jun 30, 2014, 5:53:02 AM (10 years ago)
Author:
jeremyhu (Jeremy Huddleston Sequoia)
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #44062, comment 60

    initial v1  
    3333#include <pthread.h>
    3434#include <stdio.h>
     35#include <unistd.h>
    3536
    3637#define NUM_THREADS 5
     
    3940
    4041void * test_thread(void *arg) {
    41     return &value;
     42    printf("%p\n", &value);
     43    sleep(1);
     44    return NULL;
    4245}
    4346
     
    5154
    5255    for(i=0; i < 5; i++) {
    53         void *loc;
    54         pthread_join(thread[i], &loc);
    55         printf("%p\n", loc);
     56        pthread_join(thread[i], NULL);
    5657    }
    5758
     
    6263
    6364$ ./a.out
    64 0x7fc7b3d00118
    65 0x7fc7b3e00118
    66 0x7fc7b3f00118
    67 0x7fc7b3d00118
    68 0x7fc7b3c03b28
     650x7fafd84000e8
     660x7fafd8403b18
     670x7fafd8403c38
     680x7fafd8403d58
     690x7fafd8403e78
    6970}}}