diff options
author | DiffieHellman <DiffieHellman@endianness.com> | 2023-11-18 00:18:06 +1100 |
---|---|---|
committer | DiffieHellman <DiffieHellman@endianness.com> | 2023-11-18 00:18:06 +1100 |
commit | 390b0fcfba0f1393376cf70a6602e831669c9084 (patch) | |
tree | 085fbc61772d1f186be5755d1c64570ac6ac1628 /main.c | |
parent | a620fa2bab8f6ca639a05c4e78b37581abb401e1 (diff) | |
download | sleep-sort-master.tar.gz sleep-sort-master.tar.bz2 sleep-sort-master.zip |
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,4 +1,4 @@ -/* License: Public Domain */ +/* This is released to the Public Domain */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -16,7 +16,7 @@ void *sleepMe(int *p) { /* a sleep amount of 190✕ makes it faster */ usleep((*p)*190); - + pthread_mutex_lock(&lock); result[counter++] = *p; pthread_mutex_unlock(&lock); @@ -48,6 +48,6 @@ int main() printf("%d,", result[i]); } printf("%d\n",result[NUM_THREADS-1]); - + return 0; } |