I have a usecase in which I want to acquire a condition variable and release it after some time interval( Eg: I have a queue of time ordered events and I want to block for a specified duration .)
Duration = Earliest Time in Q - Current Time()
I came across the following which would exactly serve my purpose.
pthread_cond_timedwait(pthread_cond_t *restrict cond,
pthread_mutex_t *restrict mutex,
const struct timespec *restrict abstime);
But the problem is timespec.sec is of time_t ( which is a 32 signed type ) and it overflows. Is there a workaround for this ? Is there any other construct available which we will be to block for a longer time ? I am using a Linux platform.