Difference between DEFINE_MUTEX and mutex_init

Original post here.

 

DEFINE_MUTEX defines and initializes mutex. It is useful for define global mutexes.

mutex_init initializes already allocated mutex. It is used for per-object mutexes, when mutex is just a field in a heap-allocated object.

Any of these methods is sufficient for initialize mutex.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s