diff options
author | Gentoo <installgentoo@endianness.com> | 2020-08-27 10:10:52 +1000 |
---|---|---|
committer | Gentoo <installgentoo@endianness.com> | 2020-08-27 10:10:52 +1000 |
commit | 6017bdcaf72bb71d124648fb8b55ec64a9a76879 (patch) | |
tree | 0470bab4d3656026fc84eb672e20ec284f460f2e | |
parent | c3f1ebf75de0b6e038c05c33544a58da97b64df7 (diff) | |
download | sleep-sort-6017bdcaf72bb71d124648fb8b55ec64a9a76879.tar.gz sleep-sort-6017bdcaf72bb71d124648fb8b55ec64a9a76879.tar.bz2 sleep-sort-6017bdcaf72bb71d124648fb8b55ec64a9a76879.zip |
made portable
-rw-r--r-- | main.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -3,7 +3,7 @@ #include <unistd.h> #include <pthread.h> -int64_t sortMe[] = {9,8,7,6,5,4,3,2,1,0,22,2,39,88,56,4,42,2,5}; +int sortMe[] = {9,8,7,6,5,4,3,2,1,0,22,2,39,88,56,4,42,2,5}; #define NUM_THREADS sizeof(sortMe)/sizeof(sortMe[0]) int result[NUM_THREADS]; @@ -12,7 +12,7 @@ int counter = 0; void *sleepMe(int64_t *p) { - int64_t n = *p; + int n = *p; usleep(n*500);//*200 will do, but *500 is needed to reliably attain a correct order for numbers only 1 apart pthread_mutex_lock(&lock); |