GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > IPBS / V0-0-1
Constituent: pbs     Tag: i845e
#include "IPBS/RWF.h"
#include "IPBS/RW.h"
Include dependency graph for RWF.c:
Data Structures | |
struct | _RWF_ctl |
Control handle for the RWF routines. More... | |
Functions | |
int | RWF_sizeof (void) |
Returns the size, in bytes, of an RWF control handle. | |
int | RWF_init (RWF_ctl *rwf, RW_type type, void *ctx, RW_get_cb get, RW_free_cb free) |
Initializes the RWF control structure. | |
int | RWF_destroy (RWF_ctl *rwf) |
Destroys an RWF control handle, returning any resources garnered by the RWF_init() routine. | |
int | RWF_free (RWF_ctl *rwf, void *resource, void *amount) |
Frees a resource, potentially waking up a task pending on an RWF_getW() or RWF_getW_toc(). | |
void * | RWF_get (RWF_ctl *rwf, void *amount) |
Attempts to allocate a resource using the provided free routine. Whether the resource is available or not, this routine returns immediately with the return value of the get routine. See RWF_getW() and RWF_getW_toc() for versions that implement waiting. | |
void * | RWF_getW (RWF_ctl *rwf, void *amount) |
Attempts to allocate a resource using the provided get routine. This routine blocks until the get routine returns a non-NULL value. If nowaiting is desired, see RW_get(). If a waiting with a timeout is desired, see RW_getW_toc(). | |
void * | RWF_getW_toc (RWF_ctl *rwf, void *amount, const TOC *toc) |
Attempts to allocate a resource using the provided get routine. This routine blocks until the get routine returns a non-NULL value or until the timeout period expires. If nowaiting is desired, see RW_get(). If a waiting with no timeout is desired, see RW_getW_toc(). |
CVS $Id: RWF.c,v 1.1.1.1 2006/02/10 21:45:33 saxton Exp $
This is just a convenience packaging of the RW routines. One allocates and initializes an RWF control structure containing a synchronization structure (the RW_ctl block), a get routine and a free routine. The user then calls RWF_get and RWF_free to allocate resources.
|
Destroys an RWF control handle, returning any resources garnered by the RWF_init() routine.
|
|
Frees a resource, potentially waking up a task pending on an RWF_getW() or RWF_getW_toc().
|
|
Attempts to allocate a resource using the provided free routine. Whether the resource is available or not, this routine returns immediately with the return value of the get routine. See RWF_getW() and RWF_getW_toc() for versions that implement waiting.
While the name of the amount parameter is suggestive, it is, in fact, just a void *, so the get routine may make any use of it that it pleases. |
|
Attempts to allocate a resource using the provided get routine. This routine blocks until the get routine returns a non-NULL value. If nowaiting is desired, see RW_get(). If a waiting with a timeout is desired, see RW_getW_toc().
While the name of the amount parameter is suggestive, it is, in fact, just a void *, so the get routine may make any use of it that it pleases. |
|
Attempts to allocate a resource using the provided get routine. This routine blocks until the get routine returns a non-NULL value or until the timeout period expires. If nowaiting is desired, see RW_get(). If a waiting with no timeout is desired, see RW_getW_toc().
While the name of the amount parameter is suggestive, it is, in fact, just a void *, so the get routine may make any use of it that it pleases. |
|
Initializes the RWF control structure.
void *resource = (*get)(void *ctx, void *amount); A successful allocation returns resource as non-NULL. Typically ctx is a context parameter and amount is the amount of the resource being requested.
(*free)(void *ctx, void *resource, void *amount); where typically the ctx provides context to the free routine, the resource is a pointer to the resource being freed, and amount is the amount of the resource being freed. Note that while the amount parameter name is suggestive that this represents the amount of a resource gathered, it is, in fact, just a void *, so the user is free to pass any 32-bit value that he wishes. Again, typically the freer will be handed the resource parameter and the amount parameter and be expected to just pass them on to RW_free(). |
|
Returns the size, in bytes, of an RWF control handle.
|