Can I use mutex between different functions?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Can I use mutex between different functions?

ソリューションへジャンプ
1,414件の閲覧回数
danielchai
Senior Contributor I

Hi All,

I am new to mutex and I read that the mutex is used for different tasks to share the resource.

My question is that can I use mutex in different functions?

Thank you.

-Daniel

0 件の賞賛
返信
1 解決策
1,246件の閲覧回数
anthony_huereca
NXP Employee
NXP Employee

Hi Daniel,

  Yes, by making the mutex a global variable, you can use it across your code in different tasks and functions. Take a look at C:\Freescale\Freescale_MQX_4_0\mqx\examples\mutex\main.c to see an example of this being done.

-Anthony

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
1,247件の閲覧回数
anthony_huereca
NXP Employee
NXP Employee

Hi Daniel,

  Yes, by making the mutex a global variable, you can use it across your code in different tasks and functions. Take a look at C:\Freescale\Freescale_MQX_4_0\mqx\examples\mutex\main.c to see an example of this being done.

-Anthony

0 件の賞賛
返信