VirtualBox

Changeset 44421 in vbox for trunk/src


Ignore:
Timestamp:
Jan 28, 2013 12:42:07 PM (12 years ago)
Author:
vboxsync
Message:

mpVM -> mpUVM in comments and such.

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/ConsoleImpl.h

    r44419 r44421  
    333333#if 0
    334334    /**
    335      *  Helper class that protects sections of code using the mpVM pointer by
     335     *  Helper class that protects sections of code using the mpUVM pointer by
    336336     *  automatically calling addVMCaller() on construction and
    337337     *  releaseVMCaller() on destruction. Intended for Console methods dealing
    338      *  with mpVM. The usage pattern is:
     338     *  with mpUVM. The usage pattern is:
    339339     *  <code>
    340340     *      AutoVMCaller autoVMCaller(this);
    341341     *      if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
    342342     *      ...
    343      *      VMR3ReqCall (mpVM, ...
     343     *      VMR3ReqCall (mpUVM, ...
    344344     *  </code>
    345345     *
     
    737737    /** The user mode VM handle. */
    738738    PUVM mpUVM;
    739     /** Holds the number of "readonly" mpVM/mpUVM callers (users) */
     739    /** Holds the number of "readonly" mpUVM callers (users). */
    740740    uint32_t mVMCallers;
    741     /** Semaphore posted when the number of mpVM callers drops to zero */
     741    /** Semaphore posted when the number of mpUVM callers drops to zero. */
    742742    RTSEMEVENT mVMZeroCallersSem;
    743     /** true when Console has entered the mpVM destruction phase */
     743    /** true when Console has entered the mpUVM destruction phase. */
    744744    bool mVMDestroying : 1;
    745     /** true when power down is initiated by vmstateChangeCallback (EMT) */
     745    /** true when power down is initiated by vmstateChangeCallback (EMT). */
    746746    bool mVMPoweredOff : 1;
    747747    /** true when vmstateChangeCallback shouldn't initiate a power down.  */
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r44419 r44421  
    28362836        }
    28372837
    2838         /* create a task object early to ensure mpVM protection is successful */
     2838        /* Create a task object early to ensure mpUVM protection is successful. */
    28392839        std::auto_ptr<VMSaveTask> task(new VMSaveTask(this, pProgress,
    28402840                                                      stateFilePath,
     
    54175417    AssertComRCReturnRC(autoCaller.rc());
    54185418
    5419     /* protect mpVM (if not NULL) */
     5419    /* protect mpUVM (if not NULL) */
    54205420    AutoVMCallerWeak autoVMCaller(this);
    5421     if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
     5421    if (FAILED(autoVMCaller.rc()))
     5422        return autoVMCaller.rc();
    54225423
    54235424    /* Note: validity of mVMMDev which is bound to uninit() is guaranteed by
     
    54965497    AssertComRCReturnRC(autoCaller.rc());
    54975498
    5498     /* protect mpVM (if not NULL) */
     5499    /* protect mpUVM (if not NULL) */
    54995500    AutoVMCallerWeak autoVMCaller(this);
    5500     if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
     5501    if (FAILED(autoVMCaller.rc()))
     5502        return autoVMCaller.rc();
    55015503
    55025504    /* Note: validity of mVMMDev which is bound to uninit() is guaranteed by
     
    55765578    AssertComRCReturnRC(autoCaller.rc());
    55775579
    5578     /* protect mpVM (if not NULL) */
     5580    /* protect mpUVM (if not NULL) */
    55795581    AutoVMCallerWeak autoVMCaller(this);
    5580     if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
     5582    if (FAILED(autoVMCaller.rc()))
     5583        return autoVMCaller.rc();
    55815584
    55825585    /* Note: validity of mVMMDev which is bound to uninit() is guaranteed by
     
    60916094
    60926095/**
    6093  * Increases the usage counter of the mpVM pointer. Guarantees that
    6094  * VMR3Destroy() will not be called on it at least until releaseVMCaller()
    6095  * is called.
    6096  *
    6097  * If this method returns a failure, the caller is not allowed to use mpVM
    6098  * and may return the failed result code to the upper level. This method sets
    6099  * the extended error info on failure if \a aQuiet is false.
     6096 * Increases the usage counter of the mpUVM pointer.
     6097 *
     6098 * Guarantees that VMR3Destroy() will not be called on it at least until
     6099 * releaseVMCaller() is called.
     6100 *
     6101 * If this method returns a failure, the caller is not allowed to use mpUVM and
     6102 * may return the failed result code to the upper level. This method sets the
     6103 * extended error info on failure if \a aQuiet is false.
    61006104 *
    61016105 * Setting \a aQuiet to true is useful for methods that don't want to return
    61026106 * the failed result code to the caller when this method fails (e.g. need to
    6103  * silently check for the mpVM availability).
    6104  *
    6105  * When mpVM is NULL but \a aAllowNullVM is true, a corresponding error will be
     6107 * silently check for the mpUVM availability).
     6108 *
     6109 * When mpUVM is NULL but \a aAllowNullVM is true, a corresponding error will be
    61066110 * returned instead of asserting. Having it false is intended as a sanity check
    6107  * for methods that have checked mMachineState and expect mpVM *NOT* to be NULL.
     6111 * for methods that have checked mMachineState and expect mpUVM *NOT* to be
     6112 * NULL.
    61086113 *
    61096114 * @param aQuiet       true to suppress setting error info
    6110  * @param aAllowNullVM true to accept mpVM being NULL and return a failure
    6111  *                     (otherwise this method will assert if mpVM is NULL)
     6115 * @param aAllowNullVM true to accept mpUVM being NULL and return a failure
     6116 *                     (otherwise this method will assert if mpUVM is NULL)
    61126117 *
    61136118 * @note Locks this object for writing.
     
    61466151
    61476152/**
    6148  * Decreases the usage counter of the mpVM pointer. Must always complete
    6149  * the addVMCaller() call after the mpVM pointer is no more necessary.
     6153 * Decreases the usage counter of the mpUVM pointer.
     6154 *
     6155 * Must always complete the addVMCaller() call after the mpUVM pointer is no
     6156 * more necessary.
    61506157 *
    61516158 * @note Locks this object for writing.
     
    67686775 * Calling it in situations other than the above will cause unexpected behavior.
    67696776 *
    6770  * Note that this method should be the only one that destroys mpVM and sets it
     6777 * Note that this method should be the only one that destroys mpUVM and sets it
    67716778 * to NULL.
    67726779 *
     
    68756882
    68766883    /* ----------------------------------------------------------------------
    6877      * Now, wait for all mpVM callers to finish their work if there are still
    6878      * some on other threads. NO methods that need mpVM (or initiate other calls
     6884     * Now, wait for all mpUVM callers to finish their work if there are still
     6885     * some on other threads. NO methods that need mpUVM (or initiate other calls
    68796886     * that need it) may be called after this point
    68806887     * ---------------------------------------------------------------------- */
     
    68896896            RTSemEventCreate(&mVMZeroCallersSem);
    68906897
    6891         LogFlowThisFunc(("Waiting for mpVM callers (%d) to drop to zero...\n",
    6892                           mVMCallers));
     6898        LogFlowThisFunc(("Waiting for mpUVM callers (%d) to drop to zero...\n", mVMCallers));
    68936899
    68946900        alock.release();
     
    69696975        }
    69706976
    6971         /* Now we've got to destroy the VM as well. (mpVM is not valid beyond
     6977        /* Now we've got to destroy the VM as well. (mpUVM is not valid beyond
    69726978         * this point). We release the lock before calling VMR3Destroy() because
    69736979         * it will result into calling destructors of drivers associated with
    69746980         * Console children which may in turn try to lock Console (e.g. by
    6975          * instantiating SafeVMPtr to access mpVM). It's safe here because
     6981         * instantiating SafeVMPtr to access mpUVM). It's safe here because
    69766982         * mVMDestroying is set which should prevent any activity. */
    69776983
     
    69977003        {
    69987004            LogFlowThisFunc(("Machine has been destroyed (mMachineState=%d)\n",
    6999                               mMachineState));
     7005                             mMachineState));
    70007006            /* Note: the Console-level machine state change happens on the
    70017007             * VMSTATE_TERMINATE state change in vmstateChangeCallback(). If
     
    73237329 * @param aHostPath    Shared folder path.
    73247330 *
    7325  * @note Must be called from under AutoVMCaller and when mpVM != NULL!
     7331 * @note Must be called from under AutoVMCaller and when mpUVM != NULL!
    73267332 * @note Doesn't lock anything.
    73277333 */
     
    74357441 * @param aName        Shared folder name.
    74367442 *
    7437  * @note Must be called from under AutoVMCaller and when mpVM != NULL!
     7443 * @note Must be called from under AutoVMCaller and when mpUVM != NULL!
    74387444 * @note Doesn't lock anything.
    74397445 */
     
    75467552                /* Setup task object and thread to carry out the operation
    75477553                 * asynchronously (if we call powerDown() right here but there
    7548                  * is one or more mpVM callers (added with addVMCaller()) we'll
     7554                 * is one or more mpUVM callers (added with addVMCaller()) we'll
    75497555                 * deadlock).
    75507556                 */
  • trunk/src/VBox/Main/src-client/DisplayImpl.cpp

    r44402 r44421  
    55
    66/*
    7  * Copyright (C) 2006-2012 Oracle Corporation
     7 * Copyright (C) 2006-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    7777
    7878#ifdef DEBUG_sunlover
    79 static STAMPROFILE StatDisplayRefresh;
    80 static int stam = 0;
     79static STAMPROFILE g_StatDisplayRefresh;
     80static int g_stam = 0;
    8181#endif /* DEBUG_sunlover */
    8282
     
    856856
    857857#ifdef DEBUG_sunlover
    858         if (!stam)
    859         {
    860             /* protect mpVM */
    861             Console::SafeVMPtr ptrVM (mParent);
    862             AssertComRC (ptrVM.rc());
    863 
    864             STAM_REG(ptrVM.raw(), &StatDisplayRefresh, STAMTYPE_PROFILE, "/PROF/Display/Refresh", STAMUNIT_TICKS_PER_CALL, "Time spent in EMT for display updates.");
    865             stam = 1;
     858        if (!g_stam)
     859        {
     860            Console::SafeVMPtr ptrVM(mParent);
     861            AssertComRC(ptrVM.rc());
     862            STAMR3RegisterU(ptrVM.rawUVM(), &g_StatDisplayRefresh, STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS,
     863                            "/PROF/Display/Refresh", STAMUNIT_TICKS_PER_CALL, "Time spent in EMT for display updates.");
     864            g_stam = 1;
    866865        }
    867866#endif /* DEBUG_sunlover */
     
    32103209
    32113210#ifdef DEBUG_sunlover
    3212     STAM_PROFILE_START(&StatDisplayRefresh, a);
     3211    STAM_PROFILE_START(&g_StatDisplayRefresh, a);
    32133212#endif /* DEBUG_sunlover */
    32143213
     
    33493348
    33503349                /* Just return in case of failure without any assertion */
    3351                 if( RT_SUCCESS(rc))
     3350                if (RT_SUCCESS(rc))
    33523351                    if (RT_SUCCESS(VideoRecDoRGBToYUV(pDisplay->mpVideoRecContext, u32VideoRecImgFormat)))
    33533352                        VideoRecEncodeAndWrite(pDisplay->mpVideoRecContext, ulGuestWidth, ulGuestHeight);
     
    33573356
    33583357#ifdef DEBUG_sunlover
    3359     STAM_PROFILE_STOP(&StatDisplayRefresh, a);
     3358    STAM_PROFILE_STOP(&g_StatDisplayRefresh, a);
    33603359#endif /* DEBUG_sunlover */
    33613360#ifdef DEBUG_sunlover_2
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