> In article <20130329032804.23b1514a...@mail.netbsd.org>,
> YAMAMOTO Takashi <y...@mwd.biglobe.ne.jp> wrote:
>>
>>"mono" escaping its scope?
> 
> Yes, I already added it to lwp_park to avoid the hack but not using
> the syscall yet until we decide what we need to pass to lwp_park
> to avoid priority inversion and fix the races in pthread_cond_*.
> 
> christos

i meant the following code.
struct timespec mono will be used after the end of the block.
is it safe?

                if (pthread_cond_getclock(cond) == CLOCK_MONOTONIC) {
                        struct timespec mono, real;
                        if (clock_gettime(CLOCK_REALTIME, &real) == -1 ||
                            clock_gettime(CLOCK_MONOTONIC, &mono) == -1)
                                return errno;
                        timespecsub(abstime, &mono, &mono);
                        timespecadd(&mono, &real, &mono);
                        abstime = &mono;
                }

Reply via email to