--- trunk/livstidsfanger.c 2014/11/09 15:15:31 13 +++ trunk/livstidsfanger.c 2014/11/19 19:32:53 15 @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -17,6 +18,10 @@ #include #include +#if _POSIX_THREADS < 200112L +#error her mangler det støtte for POSIX Threads anno 2001 +#endif + #if __STDC_VERSION__ >= 201112L #include #else @@ -177,6 +182,10 @@ noreturn void *livstidsfange(void *arg) printf("livstidsfange %2zu låser opp mutex\n", i + 1); pthread_mutex_unlock(&mutex); printf("livstidsfange %2zu har låst opp mutex\n", i + 1); + +#ifdef _POSIX_PRIORITY_SCHEDULING + sched_yield(); +#endif } // while } // livstidsfange()