diff --git a/src/libCom/osi/os/vxWorks/osdThread.c b/src/libCom/osi/os/vxWorks/osdThread.c index b3d54c118..b3f2009c5 100644 --- a/src/libCom/osi/os/vxWorks/osdThread.c +++ b/src/libCom/osi/os/vxWorks/osdThread.c @@ -51,16 +51,28 @@ static SEM_ID threadOnceMutex = 0; /* osi = 199 - vx */ static unsigned int getOsiPriorityValue(int ossPriority) -{ - return(199-ossPriority); +{ + if ( ossPriority < 100 ) { + return threadPriorityMax; + } + else if ( ossPriority > 199 ) { + return threadPriorityMin; + } + else { + return ( 199u - (unsigned int) ossPriority ); + } } static int getOssPriorityValue(unsigned int osiPriority) { - return(199 - osiPriority); + if ( osiPriority > 99 ) { + return 100; + } + else { + return ( 199 - (signed int) osiPriority ); + } } - unsigned int threadGetStackSize (threadStackSizeClass stackSizeClass) {