X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=c%2Fpthread_extra%2Fpthread_pause.c;h=d168121f20e6fb986440380865beb5bbe2cb2867;hb=8df6da88c80f10cb96ed53233ce6c4d414368059;hp=c0d43507d12702e4b6174d99d299e8cbbb3700df;hpb=7e0f3dba1713edfea98cdfe7909c08f68fa5f7b7;p=mirrors%2FPrograms.git diff --git a/c/pthread_extra/pthread_pause.c b/c/pthread_extra/pthread_pause.c index c0d4350..d168121 100644 --- a/c/pthread_extra/pthread_pause.c +++ b/c/pthread_extra/pthread_pause.c @@ -63,6 +63,12 @@ int pthread_pause_reschedule(pthread_t thread) { return 0; } +int pthread_extra_yield() { + //Yield to both schedulers + pthread_pause_reschedule(pthread_self()); + return pthread_yield(); +} + int pthread_pause(pthread_t thread) { //Set thread as paused and notify it via signal (wait when queue full) pthread_user_data_internal(thread)->running = 0;