use sleep timed after sched_yield for spinning busy loop

This commit is contained in:
Andrew 2019-03-03 19:41:44 +02:00
parent c2c6286503
commit 27d0379a97
1 changed files with 5 additions and 1 deletions

View File

@ -366,7 +366,11 @@ typedef int blasint;
*/
#ifndef YIELDING
#define YIELDING sched_yield()
#define YIELDING nanosleep((const struct timespec[]){{0,10000L}},NULL);
// Line above is equal to following, but compliant with much older POSIX spec
// #define YIELDING usleep(10);
// Linux 2.4 might gain from implied scheduler programming instead
// #define YIELDING sched_yield()
#endif
/***