~ubuntu-branches/ubuntu/raring/virtualbox-ose/raring

« back to all changes in this revision

Viewing changes to src/VBox/Runtime/common/time/timesupref.h

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2011-01-30 23:27:25 UTC
  • mfrom: (0.3.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20110130232725-2ouajjd2ggdet0zd
Tags: 4.0.2-dfsg-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Add Apport hook.
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Drop *-source packages.
* Drop ubuntu-01-fix-build-gcc45.patch, fixed upstream.
* Drop ubuntu-02-as-needed.patch, added to the Debian package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: timesupref.h $ */
 
1
/* $Id: timesupref.h 33540 2010-10-28 09:27:05Z vboxsync $ */
2
2
/** @file
3
3
 * IPRT - Time using SUPLib, the C Code Template.
4
4
 */
35
35
 * any previous calls in the same thread.
36
36
 *
37
37
 * @remark  The way the ever increasing time guarantee is currently implemented means
38
 
 *          that if you call this function at a freqency higher than 1GHz you're in for
 
38
 *          that if you call this function at a frequency higher than 1GHz you're in for
39
39
 *          trouble. We currently assume that no idiot will do that for real life purposes.
40
40
 *
41
41
 * @returns Nanosecond timestamp.
104
104
    {
105
105
        /*
106
106
         * We've expired the interval, cap it. If we're here for the 2nd
107
 
         * time without any GIP update inbetween, the checks against
 
107
         * time without any GIP update in-between, the checks against
108
108
         * *pu64Prev below will force 1ns stepping.
109
109
         */
110
110
        pData->cExpired++;
154
154
        /*
155
155
         * Attempt updating the previous value, provided we're still ahead of it.
156
156
         *
157
 
         * There is no point in recalculating u64NanoTS because we got preemted or if
 
157
         * There is no point in recalculating u64NanoTS because we got preempted or if
158
158
         * we raced somebody while the GIP was updated, since these are events
159
 
         * that might occure at any point in the return path as well.
 
159
         * that might occur at any point in the return path as well.
160
160
         */
161
161
        pData->cUpdateRaces++;
162
162
        for (int cTries = 25; cTries > 0; cTries--)