GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> PBS / V2-12-1 > pbs / rhel6-32
#include <PBS/RW.h>
Functions | |
int | RW_free (RW_ctl *rw, RW_free_cb free, void *ctx, void *resource, void *amount) |
Frees a resource, potentially waking up a task pending on an RW_get(). | |
void * | RW_get (RW_ctl *rw, RW_get_cb get, void *ctx, void *amount) |
Attempts to allocate a resource using the provided get routine. Whether the resource is available or not, this routine returns immediately with the return value of the get routine. See RW_getW() and RW_getW_toc() for versions that implement waiting. If the resource is disabled, the routine returns NULL. | |
void * | RW_getW (RW_ctl *rw, RW_get_cb get, void *ctx, 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 * | RW_getW_toc (RW_ctl *rw, RW_get_cb get, void *ctx, 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: RW.c,v 1.7 2011/03/31 01:09:46 russell Exp $
int RW_free | ( | RW_ctl * | rw, | |
RW_free_cb | free, | |||
void * | ctx, | |||
void * | resource, | |||
void * | amount | |||
) |
Frees a resource, potentially waking up a task pending on an RW_get().
rw | The RW handle | |
free | User provide callback routine to implement the actual freeing of the resource. The function signature is |
(*free)(void *ctx, void *resource, void *amount);
where typically 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.
ctx | Context parameter to the free routine | |
resource | The resource being freed. | |
amount | Typically the amount being freed. |
References RW__lock(), RW__unlock(), and RW__wake().
Referenced by RWF_free().
Attempts to allocate a resource using the provided get routine. Whether the resource is available or not, this routine returns immediately with the return value of the get routine. See RW_getW() and RW_getW_toc() for versions that implement waiting. If the resource is disabled, the routine returns NULL.
rw | The RW handle | |
get | A user provide 'get' routine. The function signature is |
void *resource = (*get)(void *ctx, void *amount);
ctx | A context parameter passed to the get routine. | |
amount | The amount of the resource being requested. |
While the names of the two parameters to the get routine are suggestive, they are, in fact, just two void *'s, so the get routine may make any use of them it pleases.
References _RW_waitctl_u::bf, RW__lock(), RW_unlock(), and _RW_ctl::waiting.
Referenced by RWF_get().
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().
rw | The RW handle | |
get | A user provide 'get' routine. The function signature is |
void *resource = (*get)(void *ctx, void *amount);
ctx | A context parameter passed to the get routine. | |
amount | The amount of the resource being requested. |
While the names of the two parameters to the get routine are suggestive, they are, in fact, just two void *'s, so the get routine may make any use of them it pleases.
References _RW_waitctl_u::bf, RW__lock(), RW__unlock(), RW__wait(), and _RW_ctl::waiting.
Referenced by FPA_getW(), LI__removeW(), PL__getW(), PL__removeW(), QI__removeW(), and RWF_getW().
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().
rw | The RW handle | |
get | A user provide 'get' routine. The function signature is |
void *resource = (*get)(void *ctx, void *amount);
ctx | A context parameter passed to the get routine. | |
amount | The amount of the resource being requested. | |
toc | The timeout control structure. TOC_NOWAIT and TOC_FOREVER may be specified. |
While the names of the two parameters to the get routine are suggestive, they are, in fact, just two void *'s, so the get routine may make any use of them it pleases.
References _RW_waitctl_u::bf, RW__tmr_destroy(), RW__tmr_init(), RW__tmr_lock(), RW__tmr_unlock(), RW__tmr_wait(), RW_M_TIMEDOUT, and _RW_ctl::waiting.
Referenced by FPA_getW_toc(), LI__removeW_toc(), PL__getW_toc(), PL__removeW_toc(), QI__removeW_toc(), and RWF_getW_toc().