VirtualBox

Changeset 47352 in vbox for trunk/include/iprt


Ignore:
Timestamp:
Jul 23, 2013 4:19:20 PM (11 years ago)
Author:
vboxsync
Message:

Runtime/r0drv: Reference counting for kernel thread-context hooks.

Location:
trunk/include/iprt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/mangling.h

    r47344 r47352  
    15941594# define RTThreadCtxHooksCreate                         RT_MANGLER(RTThreadCtxHooksCreate)         /* r0drv */
    15951595# define RTThreadCtxHooksDeregister                     RT_MANGLER(RTThreadCtxHooksDeregister)     /* r0drv */
    1596 # define RTThreadCtxHooksDestroy                        RT_MANGLER(RTThreadCtxHooksDestroy)        /* r0drv */
    15971596# define RTThreadCtxHooksRegister                       RT_MANGLER(RTThreadCtxHooksRegister)       /* r0drv */
     1597# define RTThreadCtxHooksRelease                        RT_MANGLER(RTThreadCtxHooksRelease)        /* r0drv */
     1598# define RTThreadCtxHooksRetain                         RT_MANGLER(RTThreadCtxHooksRetain)         /* r0drv */
    15981599# define RTThreadFromNative                             RT_MANGLER(RTThreadFromNative)
    15991600# define RTThreadGetAffinity                            RT_MANGLER(RTThreadGetAffinity)
  • trunk/include/iprt/thread.h

    r47206 r47352  
    610610
    611611/**
    612  * Create a handle for a thread-context hook.
     612 * Initializes a thread-context hook for the current thread.
    613613 *
    614614 * This must be called once per-thread before using RTThreadCtxHooksRegister().
     
    617617 * @param   phThreadCtx         Where to store the thread-context handle.
    618618 *
    619  * @remarks Must be called with preemption enabled!
     619 * @remarks This must be called with preemption enabled!
    620620 */
    621621RTDECL(int) RTThreadCtxHooksCreate(PRTTHREADCTX phThreadCtx);
    622622
    623623/**
    624  * Destroy a thread-context hook handle for the current thread.
    625  *
    626  * This will deregister any thread-context hooks registered under this handle if
    627  * required.
    628  *
     624 * Retains a new reference to a thread-context hook.
     625 *
     626 * @returns New reference count.
     627 *          UINT32_MAX is returned if the handle is invalid (asserted).
    629628 * @param   phThreadCtx         Pointer to the thread-context handle.
    630629 *
    631  * @remarks Must be called with preemption enabled!
    632  */
    633 RTDECL(void) RTThreadCtxHooksDestroy(RTTHREADCTX hThreadCtx);
     630 * @remarks This can be called from any thread. Can be called with preemption
     631 *          disabled.
     632 */
     633RTDECL(uint32_t) RTThreadCtxHooksRetain(RTTHREADCTX hThreadCtx);
     634
     635/**
     636 * Releases a reference to a thread-context hook.
     637 *
     638 * @returns New reference count, if 0 the thread-context hook was freed.
     639 *          UINT32_MAX is returned if the handle is invalid (asserted).
     640 * @param   phThreadCtx         Pointer to the thread-context handle.
     641 *
     642 * @remarks This can be called from any thread but must be called with
     643 *          preemption enabled!
     644 */
     645RTDECL(uint32_t) RTThreadCtxHooksRelease(RTTHREADCTX hThreadCtx);
    634646
    635647/**
     
    648660
    649661/**
    650  * Deregisters a thread-context hook for the current thread.
     662 * Deregisters the thread-context hook for the current thread.
    651663 *
    652664 * @returns IPRT status code.
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