All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] Function to get state of lock variable
@ 2015-08-18 12:14 Wolfgang Netbal
  2015-08-18 12:48 ` Gilles Chanteperdrix
  2015-08-24  7:36 ` Jan Kiszka
  0 siblings, 2 replies; 5+ messages in thread
From: Wolfgang Netbal @ 2015-08-18 12:14 UTC (permalink / raw)
  To: Xenomai Mailing List

Hi All,

is there a function te returns true or false if a rtdm_lock_t variable 
is set ?
What I have to do is  to check in an interrupt routine if the list is 
locked,
if this is the case I leave the interrupt handler befor accessing the list.

I use the following code to lock the add and replace of list elements.

static rtdm_lock_t opendev_list_lock;
static int open(struct rtdm_dev_context *context, rtdm_user_info_t * 
user_info, int oflags)
{
     lrtdrv_context_t *ctx = (lrtdrv_context_t *) context->dev_private;
     rtdm_lockctx_t s;

....

     rtdm_lock_get_irqsave(&opendev_list_lock, s);
     list_add_tail(&ctx->opendev_entry, &lrtdrv_opendev_list);
     rtdm_lock_put_irqrestore(&opendev_list_lock, s);


     return 0;
}

Kind regards
-- 
Wolfgang Netbal
Softwareentwicklung
________________________________

SIGMATEK GmbH & Co KG
Sigmatekstraße 1
5112 Lamprechtshausen
Österreich / Austria

Tel.: +43/6274/4321-0
Fax: +43/6274/4321-300
E-Mail: wolfgang.netbal@sigmatek.at
http://www.sigmatek-automation.at

****************************Please note: ****************************
This email and all attachments are confidential and intended solely
for the person or entity to whom it is addressed. If you are not the
named addressee you must not make this email and all attachments
accessible to any other person. If you have received this email in
error please delete it together with all attachments.
*********************************************************************

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-08-24  7:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-18 12:14 [Xenomai] Function to get state of lock variable Wolfgang Netbal
2015-08-18 12:48 ` Gilles Chanteperdrix
2015-08-18 13:29   ` Wolfgang Netbal
2015-08-18 20:34     ` Gilles Chanteperdrix
2015-08-24  7:36 ` Jan Kiszka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.