| 9 |
|
|
| 10 |
#include <errno.h> |
#include <errno.h> |
| 11 |
#include <pthread.h> |
#include <pthread.h> |
| 12 |
|
#include <sched.h> |
| 13 |
#include <signal.h> |
#include <signal.h> |
| 14 |
#include <stdbool.h> |
#include <stdbool.h> |
| 15 |
#include <stdio.h> |
#include <stdio.h> |
| 18 |
#include <time.h> |
#include <time.h> |
| 19 |
#include <unistd.h> |
#include <unistd.h> |
| 20 |
|
|
| 21 |
|
#if _POSIX_THREADS < 200112L |
| 22 |
|
#error her mangler det støtte for POSIX Threads anno 2001 |
| 23 |
|
#endif |
| 24 |
|
|
| 25 |
#if __STDC_VERSION__ >= 201112L |
#if __STDC_VERSION__ >= 201112L |
| 26 |
#include <stdnoreturn.h> |
#include <stdnoreturn.h> |
| 27 |
#else |
#else |
| 182 |
printf("livstidsfange %2zu låser opp mutex\n", i + 1); |
printf("livstidsfange %2zu låser opp mutex\n", i + 1); |
| 183 |
pthread_mutex_unlock(&mutex); |
pthread_mutex_unlock(&mutex); |
| 184 |
printf("livstidsfange %2zu har låst opp mutex\n", i + 1); |
printf("livstidsfange %2zu har låst opp mutex\n", i + 1); |
| 185 |
|
|
| 186 |
|
#ifdef _POSIX_PRIORITY_SCHEDULING |
| 187 |
|
sched_yield(); |
| 188 |
|
#endif |
| 189 |
} // while |
} // while |
| 190 |
} // livstidsfange() |
} // livstidsfange() |
| 191 |
|
|