summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGentoo <installgentoo@endianness.com>2020-08-27 10:10:52 +1000
committerGentoo <installgentoo@endianness.com>2020-08-27 10:10:52 +1000
commit6017bdcaf72bb71d124648fb8b55ec64a9a76879 (patch)
tree0470bab4d3656026fc84eb672e20ec284f460f2e
parentc3f1ebf75de0b6e038c05c33544a58da97b64df7 (diff)
downloadsleep-sort-6017bdcaf72bb71d124648fb8b55ec64a9a76879.tar.gz
sleep-sort-6017bdcaf72bb71d124648fb8b55ec64a9a76879.tar.bz2
sleep-sort-6017bdcaf72bb71d124648fb8b55ec64a9a76879.zip
made portable
-rw-r--r--main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/main.c b/main.c
index a382e69..44413a6 100644
--- a/main.c
+++ b/main.c
@@ -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);