VirtualBox

vbox的更動 35802 路徑 trunk/src/VBox/Runtime/r3/posix


忽略:
時間撮記:
2011-2-1 上午08:59:25 (14 年 以前)
作者:
vboxsync
訊息:

Runtime/r3/thread-posix: Implemented sys+user time for Solaris threads. CpuExecutionCap should now work.

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Runtime/r3/posix/thread-posix.cpp

    r34628 r35802  
    3939#if defined(RT_OS_SOLARIS)
    4040# include <sched.h>
     41# include <sys/resource.h>
    4142#endif
    4243
     
    413414RTR3DECL(int) RTThreadGetExecutionTimeMilli(uint64_t *pKernelTime, uint64_t *pUserTime)
    414415{
    415 #ifndef RT_OS_DARWIN
     416#if defined(RT_OS_SOLARIS)
     417    struct rusage ts;
     418    int rc = getrusage(RUSAGE_LWP, &ts);
     419    if (rc)
     420        return RTErrConvertFromErrno(rc);
     421
     422    *pKernelTime = ts.ru_stime.tv_sec * 1000 + ts.ru_stime.tv_usec / 1000;
     423    *pUserTime   = ts.ru_utime.tv_sec * 1000 + ts.ru_utime.tv_usec / 1000;
     424    return VINF_SUCCESS;
     425#elif !defined(RT_OS_DARWIN)
    416426    struct timespec ts;
    417427    int rc = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts);
     
    426436#endif
    427437}
     438
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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