VirtualBox

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


忽略:
時間撮記:
2011-2-7 下午02:54:18 (14 年 以前)
作者:
vboxsync
訊息:

thread-posix.cpp: don't use uninitialized variables, fail instead. nits

檔案:
修改 1 筆資料

圖例:

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

    r35850 r35876  
    419419#endif
    420420
     421/** @todo move this into platform specific files. */
    421422RTR3DECL(int) RTThreadGetExecutionTimeMilli(uint64_t *pKernelTime, uint64_t *pUserTime)
    422423{
     
    430431    *pUserTime   = ts.ru_utime.tv_sec * 1000 + ts.ru_utime.tv_usec / 1000;
    431432    return VINF_SUCCESS;
     433
    432434#elif defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)
    433435    /* on Linux, getrusage(RUSAGE_THREAD, ...) is available since 2.6.26 */
     
    440442    *pUserTime = (uint64_t)ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
    441443    return VINF_SUCCESS;
     444
    442445#elif defined(RT_OS_DARWIN)
    443446    thread_basic_info ThreadInfo;
     
    446449
    447450    krc = thread_info(mach_thread_self(), THREAD_BASIC_INFO, (thread_info_t)&ThreadInfo, &Count);
    448     Assert(krc == KERN_SUCCESS);
     451    AssertReturn(krc == KERN_SUCCESS, RTErrConvertFromDarwinKern(krc));
    449452
    450453    *pKernelTime = ThreadInfo.system_time.seconds * 1000 + ThreadInfo.system_time.microseconds / 1000;
    451     *pUserTime   = ThreadInfo.user_time.seconds * 1000 + ThreadInfo.user_time.microseconds / 1000;;
     454    *pUserTime   = ThreadInfo.user_time.seconds   * 1000 + ThreadInfo.user_time.microseconds   / 1000;
    452455
    453456    return VINF_SUCCESS;
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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