Skip to contentSkip to conversation

how to check RT_MUTEX_INFO.owner

Xenomai Frederik Bayart 2 participants 2 messages Sep 14, 2015

lore
Share & tools
lore
#0 lore raw

In the documentation of RT_MUTEX_INFO is described :
RT_TASK owner : Current mutex owner, or null if unlocked.

But this is not a pointer, so it can't be compared with NULL. Should you check RT_TASK.handle ?

Frederik

#1 lore raw
Quoted 5 lines · Frederik Bayart

In the documentation of RT_MUTEX_INFO is described :
RT_TASK owner : Current mutex owner, or null if unlocked.

But this is not a pointer, so it can't be compared with NULL. Should you check RT_TASK.handle ?

You should compare the handle to NO_ALCHEMY_TASK, i.e.:

include/alchemy/task.h:#define NO_ALCHEMY_TASK ((RT_TASK){ 0, 0 })

Signature · 1 line
Philippe.