Changeset 1912 for trunk


Ignore:
Timestamp:
Apr 25, 2005, 6:50:41 AM (20 years ago)
Author:
bird
Message:

Added some logic to update iNice for the current process (might be changed externally or created by an older libc process).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/src/lib/sys/b_processGetPriority.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1911 r1912  
    3535#include <InnoTekLIBC/backend.h>
    3636#include <InnoTekLIBC/sharedpm.h>
     37#include <InnoTekLIBC/FastInfoBlocks.h>
    3738#define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_PROCESS
    3839#include <InnoTekLIBC/logstrict.h>
     
    146147        int *piNice = (int *)pvUser;
    147148        int iNice = pProcess->iNice;
     149        int iNiceCur;
     150
     151        /* Update current process if default nice. */
     152        if (    pProcess->pid == fibGetPid()
     153            &&  (   iNice > (iNiceCur = __libc_back_priorityUnixFromOS2(__libc_GpFIBLIS->prtyCurrent)) /* highest priority thread */
     154                 || (iNice != iNiceCur && iNice == 0 && fibGetTid() == 1)                              /* or if possibly uninitialized (only thread 1) */
     155                )
     156            )
     157            pProcess->iNice = iNice = iNiceCur;
     158
     159        /* min */
    148160        if (iNice < *piNice)
    149161            *piNice = iNice;
Note: See TracChangeset for help on using the changeset viewer.