GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> PBS / V2-12-1 > pbs / rhel6-32


Interface   Data Structures   File List   Data Fields   Globals  

RW_tmr.ih File Reference

Defines platform independent inline Resource Wait timer (RW_tmr) routines. More...

#include <PBS/RW_pubdefs.h>
#include <PBS/RW.h>
#include <PBS/RW.ih>
#include <RW_tmr.h>

Defines

#define _OK   ATTR_UNUSED_OK
 Abbrev for ATTR_UNUSED_OK, undef'd in this file.

Functions

RW__EXP_PROTO RW_state RW__tmr_init (RW_tmr *tmr, RW_ctl *rw, const TOC *toc) _OK
 Initializes a Resource Wait timer based on the toc. If TOC is TOC_NOWAIT or TOV_FOREVER, no timer is initialized.
RW__EXP_PROTO RW_state RW__tmr_lock (RW_tmr *tmr, RW_state state) _OK
 Locks the resource.
RW__EXP_PROTO RW_state RW__tmr_wait (RW_tmr *tmr, RW_state state) _OK
 Waits until the timer expires or another task calls RW__tmr_wake indicating that another attempt be made to allocate the resource.
RW__EXP_PROTO RW_state RW__tmr_unlock (RW_tmr *tmr, RW_state state) _OK
 Unlocks the resource.
RW__EXP_PROTO RW_state RW__tmr_destroy (RW_tmr *tmr, RW_state state) _OK
 Destroys the tmr RW handle. This should be called before exiting the routine doing the allocation, since it will cleanup any outstanding timers among other things.


Detailed Description

Defines platform independent inline Resource Wait timer (RW_tmr) routines.

Author:
JJRussell - russell@slac.stanford.edu
   CVS $Id: RW_tmr.ih,v 1.5 2011/03/24 23:05:46 apw Exp $


Function Documentation

RW__EXP_PROTO RW_state RW__tmr_destroy ( RW_tmr tmr,
RW_state  state 
)

Destroys the tmr RW handle. This should be called before exiting the routine doing the allocation, since it will cleanup any outstanding timers among other things.

Parameters:
tmr The RW timer handle
state The current state
Returns:
The updated state.
Warning:
Failure to call this routine if a timer is still on the WUT que is fatal.

Referenced by rng_allocate(), and RW_getW_toc().

RW__EXP_FNC RW_state RW__tmr_init ( RW_tmr tmr,
RW_ctl rw,
const TOC toc 
)

Initializes a Resource Wait timer based on the toc. If TOC is TOC_NOWAIT or TOV_FOREVER, no timer is initialized.

Parameters:
tmr The Resource Wait Timer to initialize
rw The underlying resource wait control structure.
toc The TimeOut control block. Two special values are recognized TOC_NOWAIT and TOC_FOREVER.
Returns:
A state variable which should be passed to RW_tmr_block.

References _RW_tmr::rw, RW_M_INCWAITING, RW_M_TIMEDOUT, RW_M_TOVCOMPUTE, RW_M_TRYAGAIN, RW_TMR_PINIT, _RW_tmr::toc, TOC_IS_FOREVER, and TOC_IS_NOWAIT.

Referenced by rng_allocate(), and RW_getW_toc().

RW__EXP_PROTO RW_state RW__tmr_lock ( RW_tmr tmr,
RW_state  state 
)

Locks the resource.

Parameters:
tmr The RW timer handle
state The current RW state
Returns:
The update RW state.

References _RW_ctl::mutex, and _RW_tmr::rw.

Referenced by rng__wait(), and RW_getW_toc().

RW__EXP_PROTO RW_state RW__tmr_unlock ( RW_tmr tmr,
RW_state  state 
)

Unlocks the resource.

Parameters:
tmr The RW timer handle
state The current RW state
Returns:
The update RW state.

References _RW_ctl::mutex, and _RW_tmr::rw.

Referenced by rng__wait(), and RW_getW_toc().

RW__EXP_PROTO RW_state RW__tmr_wait ( RW_tmr tmr,
RW_state  state 
)

Waits until the timer expires or another task calls RW__tmr_wake indicating that another attempt be made to allocate the resource.

Parameters:
tmr A previously initialized timer resource handle
state The current RW state
Returns:
The updated RW state.

References _RW_waitctl_u::bf, _RW_ctl::cond, _RW_ctl::mutex, _RW_tmr::rw, RW_M_ERROR, RW_M_INCWAITING, RW_M_TIMEDOUT, RW_M_TMRSTART, RW_M_TOVCOMPUTE, RW_M_TRYAGAIN, _RW_tmr::toc, TOC_compute(), _RW_tmr::tov, TOV_K_FOREVER, TOV_K_NOWAIT, and _RW_ctl::waiting.

Referenced by rng__wait(), and RW_getW_toc().


Generated on Mon Aug 1 14:54:43 2011 by  doxygen 1.5.8