Main Page   Interface   Data Structures   File List   Data Fields   Globals  

LLI.ih File Reference

Defines the inline Linked List Interlocked (LLI) routines. More...

#include "BBC/LL.ih"
#include "BBC/inline.h"
#include "BBC/LLI_pubdefs.h"

Defines

#define LLI__EXT_PROTO   INLINE_USR_EXT_PROTO
#define LLI__LCL_PROTO   INLINE_USR_LCL_PROTO
#define LLI__EXT_FNC   INLINE_USR_EXT_FNC
#define LLI__LCL_FNC   INLINE_USR_LCL_FNC

Functions

LLI__EXT_PROTO int LLI__init (struct _LLI_list *list, enum _LLI_type type)
 Initializes the list head of a doubly linked list to an empty list. More...

LLI__EXT_PROTO int LLI__destroy (struct _LLI_list *list)
 Destroys the data structures associate with a linked list. More...

LLI__EXT_PROTO struct _LLI_node * LLI__insert (struct _LLI_list *list, struct _LLI_node *node)
 Adds a node to the tail of a previously initialized linked list. More...

LLI__EXT_PROTO struct _LLI_node * LLI__jam (struct _LLI_list *list, struct _LLI_node *node)
 Adds a node to the head of a previously initialized linked list. More...

LLI__EXT_PROTO struct _LLI_node * LLI__remove (struct _LLI_list *list)
 Removes the node from the tail of a previously initialized linked list. An empty list returns NULL as its node. More...

LLI__EXT_PROTO int LLI__lock_init (struct _LLI_list *list, enum _LLI_type type)
 This initializes the blocking control structures. More...

LLI__EXT_PROTO LLI_key LLI__lock (struct _LLI_list *list)
 This routine blocks until a node becomes available. More...

LLI__EXT_PROTO void LLI__unlock (struct _LLI_list *list, LLI_key key)
 This routine unblocks the previously block list. More...

LLI__EXT_PROTO int LLI__wake (struct _LLI_list *list)
 This provides the signaling mechanism to wake up a thread of code which was previously blocked. More...

LLI__EXT_PROTO int LLI__lock_destroy (struct _LLI_list *list)
 Frees any resources associated with the blocking mechanism. More...

LLI__EXT_PROTO struct _LLI_node * LLI__removeW (struct _LLI_list *list, int timeout)
 Removes the node from the tail of a previously initialized linked list. If the list is empty, the thread of code is blocked until a node becomes available. More...


Detailed Description

Defines the inline Linked List Interlocked (LLI) routines.

Author:
JJRussell - russell@slac.stanford.edu
This defines the inline interlocked versions of the Linked List routines. These allow the user to build interlocked doubly linked lists. These routines parallel some of the functionality of the VxWorks llXXXX routines, but are portable to both VxWorks and host platforms.

See also the non-inlined versions of these routines which offer possible savings in code space and increased modularity at the expense of some performance. The LL routines provide the same functionality without the overhead of being interlocked.


Define Documentation

#define LLI__EXT_FNC   INLINE_USR_EXT_FNC
 

External Function declaration

#define LLI__EXT_PROTO   INLINE_USR_EXT_PROTO
 

External Prototype spec

#define LLI__LCL_FNC   INLINE_USR_LCL_FNC
 

Internal Function declaration

#define LLI__LCL_PROTO   INLINE_USR_LCL_PROTO
 

Internal Prototype spec


Function Documentation

LLI__EXT_FNC int LLI__destroy struct _LLI_list   list
 

Destroys the data structures associate with a linked list.

Parameters:
list  Pointer to the link list head to destroy.
Currently this routine is effectively a NO-OP, but is provided for upward compatibility, just in case at some time in the future this operations does something meaningful.

LLI__EXT_FNC int LLI__init struct _LLI_list   list,
enum _LLI_type    type
 

Initializes the list head of a doubly linked list to an empty list.

Parameters:
list  Pointer to the link list head to initialize.
type  The type of interlocking linked list
The linked list head is initialized to an empty list. This must be done before performing any other operations on the linked list. The type determines how the linked list blocks when one attempts to remove a node from an empty list.

LLI__EXT_FNC struct _LLI_node * LLI__insert struct _LLI_list   list,
struct _LLI_node *    node
 

Adds a node to the tail of a previously initialized linked list.

Parameters:
list  A previously initialized linked list head.
node  The node to add at the tail of the list
Returns:
Pointer to the old backward link. This can be used to test whether this was the first item on the queue.
If return_value == &list, the empty)
Adds the specified node to the tail of the list. If all nodes are added with the LLI__insert routine, the list behaves as a FIFO.

LLI__EXT_FNC struct _LLI_node * LLI__jam struct _LLI_list   list,
struct _LLI_node *    node
 

Adds a node to the head of a previously initialized linked list.

Parameters:
list  A previously initialized linked list head.
node  The node to add.
Returns:
Pointer to the old forward link. This can be used to test whether this was the first item on the queue.
If return_value == &list, the empty)
Adds the specified node to the head of the list. If all nodes are added with the LLI__jam routine, the list behaves as a LIFO.

LLI_key LLI__lock struct _LLI_list   list
 

This routine blocks until a node becomes available.

Parameters:
list  The list head of the list to block
Return values:
key  The key used to unblock the list

WARNING
This is not meant to be a user callable routine. It is included here only because INLINING demands it.

int LLI__lock_destroy struct _LLI_list   list
 

Frees any resources associated with the blocking mechanism.

Parameters:
The  list head
Return values:
Status  of the teardown procedure

WARNING
This is not meant to be a user callable routine. It is included here only because INLINING demands it.

LLI_key LLI__lock_init struct _LLI_list   list,
enum _LLI_type    type
 

This initializes the blocking control structures.

Parameters:
list  The list head
type  The type of blocking mechanism
Return values:
The  key used to lock and unlock the blocking mechanism

Returns the key used to block and unblock the blocking mechanisms. This is used when the list is to block when a removal is performed on an empty list.

WARNING
This is not meant to be a user callable routine. It is included here only because INLINING demands it.

LLI__EXT_FNC struct _LLI_node * LLI__remove struct _LLI_list   list
 

Removes the node from the tail of a previously initialized linked list. An empty list returns NULL as its node.

Parameters:
list  A previously initialized linked list head.
Returns:
A pointer to the removed node of NULL if the list is empty.

Removes the node at the head of the list. If the list is empty, NULL is returned.

struct _LLI_node * LLI__removeW struct _LLI_list   list,
int    timeout
 

Removes the node from the tail of a previously initialized linked list. If the list is empty, the thread of code is blocked until a node becomes available.

Parameters:
list  A previously initialized linked list head.
timeout  A timeout parameter. Currently the only timeout parameter is WAIT_FOREVER (-1).
Returns:
A pointer to the removed node. of NULL if the list is empty.

LLI__unlock struct _LLI_list   list,
LLI_key    key
 

This routine unblocks the previously block list.

Parameters:
list  The list head of the list to unblock
key  The key used to unblock the list

WARNING
This is not meant to be a user callable routine. It is included here only because INLINING demands it.

int LLI__wake struct _LLI_list   list
 

This provides the signaling mechanism to wake up a thread of code which was previously blocked.

Parameters:
list  The list head
Return values:
Status  of the blocking mechanism

WARNING
This is not meant to be a user callable routine. It is included here only because INLINING demands it.


Generated on Fri Mar 1 16:56:57 2002 by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001