VirtualBox

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


Ignore:
Timestamp:
Feb 7, 2011 2:54:18 PM (14 years ago)
Author:
vboxsync
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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;
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