VirtualBox

Changeset 62887 in vbox for trunk/src/VBox/Runtime/r3/posix


Ignore:
Timestamp:
Aug 2, 2016 9:26:02 PM (8 years ago)
Author:
vboxsync
Message:

iprt: Use sched_yield(2) on FreeBSD too. pthread_yield(3) there is
just a proxy for sched_yield(2) that discards its return value.

Requested by Jung-uk Kim <jkim@…>.

Location:
trunk/src/VBox/Runtime/r3/posix
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/posix/semevent-posix.cpp

    r62859 r62887  
    5050#endif
    5151
    52 #if defined(RT_OS_SOLARIS) || defined(RT_OS_HAIKU) || defined(RT_OS_NETBSD)
     52#if defined(RT_OS_SOLARIS) || defined(RT_OS_HAIKU) || defined(RT_OS_FREEBSD) || defined(RT_OS_NETBSD)
    5353# include <sched.h>
    5454# define pthread_yield() sched_yield()
  • trunk/src/VBox/Runtime/r3/posix/thread2-posix.cpp

    r62859 r62887  
    3333#include <pthread.h>
    3434#include <unistd.h>
    35 #if defined(RT_OS_SOLARIS) || defined(RT_OS_NETBSD)
     35#if defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD) || defined(RT_OS_NETBSD)
    3636# include <sched.h>
    3737#endif
     
    6161#ifdef RT_OS_DARWIN
    6262        pthread_yield_np();
    63 #elif defined(RT_OS_FREEBSD) /* void pthread_yield */
    64         pthread_yield();
    65 #elif defined(RT_OS_SOLARIS) || defined(RT_OS_HAIKU) || defined(RT_OS_NETBSD)
     63#elif defined(RT_OS_SOLARIS) || defined(RT_OS_HAIKU) || defined(RT_OS_FREEBSD) || defined(RT_OS_NETBSD)
    6664        sched_yield();
    6765#else
     
    10098#ifdef RT_OS_DARWIN
    10199        pthread_yield_np();
    102 #elif defined(RT_OS_FREEBSD) /* void pthread_yield */
    103         pthread_yield();
    104 #elif defined(RT_OS_SOLARIS) || defined(RT_OS_HAIKU) || defined(RT_OS_NETBSD)
     100#elif defined(RT_OS_SOLARIS) || defined(RT_OS_HAIKU) || defined(RT_OS_FREEBSD) || defined(RT_OS_NETBSD)
    105101        sched_yield();
    106102#else
     
    131127#ifdef RT_OS_DARWIN
    132128    pthread_yield_np();
    133 #elif defined(RT_OS_SOLARIS) || defined(RT_OS_HAIKU) || defined(RT_OS_NETBSD)
     129#elif defined(RT_OS_SOLARIS) || defined(RT_OS_HAIKU) || defined(RT_OS_FREEBSD) || defined(RT_OS_NETBSD)
    134130    sched_yield();
    135131#else
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette