what is the “attribute” of a pthread mutex?

后端 未结 4 433
暗喜
暗喜 2020-12-14 07:11

The function pthread_mutex_init allows you to specify a pointer to an attribute. But I have yet to find a good explanation of what pthread attributes are. I have always just

4条回答
  •  有刺的猬
    2020-12-14 07:28

    Applying NULL to this argument implies using the default argument. So for some reasons you could want to change these default settings (using pthread_mutexattr_init).

    The documentation explains all you need about these mutex settings.

提交回复
热议问题