Static initializers in the PTHREAD API

preview_player
Показать описание
Source code can be found here:

===== Support us through our store =====

===== Check out our website =====

===== Check out our Discord server =====
Рекомендации по теме
Комментарии
Автор

please do video on shared memory, message passing and virtual memory

ShubhamKumar-idsm
Автор

Thank you.
Can you please suggest me which is the best book for Linux for beginners?

narasarajv
Автор

class Test {
public:
static pthread_mutex_t mutex;
};

pthread_mutex_t Test::mutex ( PTHREAD_MUTEX_INITIALIZER ); - this one works

pthread_mutex_t Test::mutex { PTHREAD_MUTEX_INITIALIZER }; - while this does not, because "cannot convert '<brace-enclosed initializer list>' to 'int"

So when I initialize it like this, I can't use uniform initialization.
But why? Could you explain it to me?

Or should I just forget about brackets when initializing such a thing and simply use "=" until I get old and wise?

xofrio