Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

static mutex members

renorm
Beginner
322 Views
Hi.
Can a class have a static mutex member? Is this code OK?
[cpp]// in some header file
struct A
{
   static tbb::mutex mut;
};

// in some implementation file
tbb::mutex A::mut;[/cpp]
Thank you,
renorm.
0 Kudos
1 Reply
Dmitry_Vyukov
Valued Contributor I
322 Views
Quoting renorm
Can a class have a static mutex member? Is this code OK?

Yes. Nothing special about mutexes in this respect.

0 Kudos
Reply