[PATCH] use CLOCK_MONOTONIC_COARSE posix timer instead of CLOCK_MONOTONIC in Xorg
Daniel Stone
daniel at fooishbar.org
Mon Aug 23 18:59:46 PDT 2010
On Tue, Aug 24, 2010 at 08:32:48AM +0800, ykzhao wrote:
> On Mon, 2010-08-23 at 23:25 +0800, Adam Jackson wrote:
> > On Mon, 2010-08-23 at 10:23 +0200, Mark Kettenis wrote:
> > > > diff --git a/os/utils.c b/os/utils.c
> > > > index 51455cc..a08d591 100644
> > > > --- a/os/utils.c
> > > > +++ b/os/utils.c
> > > > @@ -242,6 +242,10 @@ OsSignal(int sig, OsSigHandlerPtr handler)
> > > > #endif
> > > > #endif
> > > >
> > > > +#ifndef CLOCK_MONOTONIC_COARSE
> > > > +#define CLOCK_MONOTONIC_COARSE 6
> > > > +#endif
> > >
> > > What if an OS doesn't have CLOCK_MONOTONIC_COARSE, but uses the clock
> > > ID 6 for some other purpose?
> >
> > Then this patch would be wrong.
> >
> > NAK on that basis.
>
> Yes. Agree.
>
> How about using the constant value(6) directly?
That doesn't change anything - if a system is using ID 6 for something
else, then using 6 is wholly incorrect, no matter whether you use the
constant directly, define some other symbol for it, or whatever.
#ifdef CLOCK_MONOTONIC_COARSE
/* include support for CLOCK_MONOTONIC_COARSE */
#else
/* it's not there so don't */
#endif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100824/45c62b2a/attachment.pgp>
More information about the xorg-devel
mailing list