VirtualBox

Ignore:
Timestamp:
Sep 11, 2013 2:08:36 PM (11 years ago)
Author:
vboxsync
Message:

Main/Machine+Session: New generic client session watcher implementation based on token objects, works on all platforms and is used for now on XPCOM. Additionally a better error message when several API clients are racing for a lock, previously it could be quite confusing.

File:
1 edited

Legend:

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

    r47561 r48431  
    33/** @file
    44 *
    5  * VirtualBox API client token abstraction
     5 * VirtualBox API client session token abstraction
    66 */
    77
     
    2525
    2626#include "MachineImpl.h"
     27#ifdef VBOX_WITH_GENERIC_SESSION_WATCHER
     28# include "TokenImpl.h"
     29#endif /* VBOX_WITH_GENERIC_SESSION_WATCHER */
    2730
    2831#if defined(RT_OS_WINDOWS)
     
    3538# define CTTOKENARG -1
    3639# define CTTOKENTYPE int
     40#elif defined(VBOX_WITH_GENERIC_SESSION_WATCHER)
     41# define CTTOKENARG NULL
     42# define CTTOKENTYPE MachineToken *
    3743#else
    3844# error "Port me!"
     
    4955     * Constructor which creates a usable instance
    5056     *
    51      * @param pMachine  Reference to Machine object
     57     * @param pMachine          Reference to Machine object
     58     * @param pSessionMachine   Reference to corresponding SessionMachine object
    5259     */
    53     ClientToken(const ComObjPtr<Machine> &pMachine);
     60    ClientToken(const ComObjPtr<Machine> &pMachine, SessionMachine *pSessionMachine);
    5461
    5562    /**
     
    7481    CTTOKENTYPE getToken();
    7582
     83#ifndef VBOX_WITH_GENERIC_SESSION_WATCHER
    7684    /**
    7785     * Release token now. Returns information if the client has terminated.
    7886     */
    7987    bool release();
     88#endif /* !VBOX_WITH_GENERIC_SESSION_WATCHER */
    8089
    8190private:
     
    8897    CTTOKENTYPE mClientToken;
    8998    Utf8Str mClientTokenId;
     99#ifdef VBOX_WITH_GENERIC_SESSION_WATCHER
     100    bool mClientTokenPassed;
     101#endif
    90102};
    91103
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