static mutex members

static mutex members

Hi.
Can a class have a static mutex member? Is this code OK?

// in some header file
struct A
{
   static tbb::mutex mut;
};

// in some implementation file
tbb::mutex A::mut;

Thank you,
renorm.

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Quoting renorm
Can a class have a static mutex member? Is this code OK?

Yes. Nothing special about mutexes in this respect.

Leave a Comment

Please sign in to add a comment. Not a member? Join today