Generated from ./inc/complib/cl_spinlock.h with ROBODoc v4.99.17 on Sun Mar 04 2007 18:17:51

[Modules] Component Library/Spinlock

[top][parent][index]

NAME

       Spinlock

DESCRIPTION

       Spinlock provides synchronization between threads for exclusive access to
       a resource.

       The spinlock functions manipulate a cl_spinlock_t structure which should
       be treated as opaque and should be manipulated only through the provided
       functions.

SEE ALSO

       Structures:
               cl_spinlock_t

       Initialization:
               cl_spinlock_construct, cl_spinlock_init, cl_spinlock_destroy

       Manipulation
               cl_spinlock_acquire, cl_spinlock_release

[Functions] Component Library: Spinlock/cl_spinlock_acquire

[top][index]

NAME

       cl_spinlock_acquire

DESCRIPTION

       The cl_spinlock_acquire function acquires a spin lock.
       This version of lock does not prevent an interrupt from
       occuring on the processor on which the code is being
       executed.

SYNOPSIS

CL_EXPORT void CL_API
cl_spinlock_acquire(
        IN      cl_spinlock_t* const    p_spinlock );

PARAMETERS

       p_spinlock
               [in] Pointer to a spin lock structure to acquire.

RETURN VALUE

       This function does not return a value.

SEE ALSO

       Spinlock, cl_spinlock_release

[Functions] Component Library: Spinlock/cl_spinlock_construct

[top][index]

NAME

       cl_spinlock_construct

DESCRIPTION

       The cl_spinlock_construct function initializes the state of a
       spin lock.

SYNOPSIS

CL_EXPORT void CL_API
cl_spinlock_construct(
        IN      cl_spinlock_t* const    p_spinlock );

PARAMETERS

       p_spinlock
               [in] Pointer to a spin lock structure whose state to initialize.

RETURN VALUE

       This function does not return a value.

NOTES

       Allows calling cl_spinlock_destroy without first calling
       cl_spinlock_init.

       Calling cl_spinlock_construct is a prerequisite to calling any other
       spin lock function except cl_spinlock_init.

SEE ALSO

       Spinlock, cl_spinlock_init, cl_spinlock_destroy

[Functions] Component Library: Spinlock/cl_spinlock_destroy

[top][index]

NAME

       cl_spinlock_destroy

DESCRIPTION

       The cl_spinlock_destroy function performs all necessary cleanup of a
       spin lock.

SYNOPSIS

CL_EXPORT void CL_API
cl_spinlock_destroy(
        IN      cl_spinlock_t* const    p_spinlock );

PARAMETERS

       p_spinlock
               [in] Pointer to a spin lock structure to destroy.

RETURN VALUE

       This function does not return a value.

NOTES

       Performs any necessary cleanup of a spin lock. This function must only
       be called if either cl_spinlock_construct or cl_spinlock_init has been
       called.

SEE ALSO

       Spinlock, cl_spinlock_construct, cl_spinlock_init

[Functions] Component Library: Spinlock/cl_spinlock_init

[top][index]

NAME

       cl_spinlock_init

DESCRIPTION

       The cl_spinlock_init function initializes a spin lock for use.

SYNOPSIS

CL_EXPORT cl_status_t CL_API
cl_spinlock_init(
        IN      cl_spinlock_t* const    p_spinlock );

PARAMETERS

       p_spinlock
               [in] Pointer to a spin lock structure to initialize.

 RETURN VALUES
       CL_SUCCESS if initialization succeeded.

       CL_ERROR if initialization failed. Callers should call
       cl_spinlock_destroy to clean up any resources allocated during
       initialization.

NOTES

       Initialize the spin lock structure. Allows calling cl_spinlock_aquire
       and cl_spinlock_release.

SEE ALSO

       Spinlock, cl_spinlock_construct, cl_spinlock_destroy,
       cl_spinlock_acquire, cl_spinlock_release

[Functions] Component Library: Spinlock/cl_spinlock_release

[top][index]

NAME

       cl_spinlock_release

DESCRIPTION

       The cl_spinlock_release function releases a spin lock object.

SYNOPSIS

CL_EXPORT void CL_API
cl_spinlock_release(
        IN      cl_spinlock_t* const    p_spinlock );

PARAMETERS

       p_spinlock
               [in] Pointer to a spin lock structure to release.

RETURN VALUE

       This function does not return a value.

NOTES

       Releases a spin lock after a call to cl_spinlock_acquire.

SEE ALSO

       Spinlock, cl_spinlock_acquire