jaepi 22 Practically a Master Poster

Hello there, I've been messing around with threads these days. Currently, I'm having problems with one of my variables of type pthread_cond_t (let's call it variable Z). I made a class (let's say class X) , and you guessed it right, Z was declared in it with private access level. Now the problem here is the initialization of Z. I initialized it with this value - PTHREAD_COND_INITIALIZER. It produces this error - error: expected primary-expression before '{' token.

This is the way I initialized it.

//constructor
X::X(): Z(PTHREAD_COND_INITIALIZER)
{
  //code here
}

What do you think is the problem?

Thanks! :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.