OpenSS7 SS7 for the Common Man |
© Copyright 1997-2004,OpenSS7 Corporation, All Rights Reserved. |
||||||||||||||||||||||||||
Home | Overview | Status | News | Documentation | Resources | About | |||||||||||||||||||||
File /code/strss7/drivers/lock.h#ifndef __LOCK_H__ #define __LOCK_H__ STATIC int ss7_osrv(queue_t *); STATIC int ss7_isrv(queue_t *); STATIC INLINE int ss7_trylockq(queue_t *q) { int res; str_t *s = STR_PRIV(q); if (!(res = lis_spin_trylock(&s->qlock))) { if (q == s->iq) s->iwait = q; if (q == s->oq) s->owait = q; } return (res); } STATIC INLINE void ss7_unlockq(queue_t *q) { str_t *s = STR_PRIV(q); lis_spin_unlock(&s->qlock); if (s->iwait) { if (s->iwait->q_qinfo && s->iwait->q_qinfo->qi_srvp) qenable(xchg(&s->iwait, NULL)); else ss7_isrv(xchg(&s->iwait, NULL)); } if (s->owait) { if (s->owait->q_qinfo && s->owait->q_qinfo->qi_srvp) qenable(xchg(&s->owait, NULL)); else ss7_osrv(xchg(&s->iwait, NULL)); } } #endif /* __LOCK_H__ */
|
|||||||||||||||||||||||||||
OpenSS7 SS7 for the Common Man |
Home | Overview | Status | News | Documentation | Resources | About | ||||||||||||||||||||
© Copyright 1997-2004,OpenSS7 Corporation, All Rights Reserved. |