[PATCH] sync: Don't allow creating a system counter before sync is initialized
Peter Hutterer
peter.hutterer at who-t.net
Tue Dec 8 14:40:47 PST 2015
On Tue, Dec 08, 2015 at 03:08:34PM -0500, Adam Jackson wrote:
> It probably doesn't work very well since there's other extension setup
> we're not doing on this path, and in any event it's not a thing that
> happens currently.
>
> Signed-off-by: Adam Jackson <ajax at redhat.com>
> ---
> Xext/sync.c | 15 +--------------
> 1 file changed, 1 insertion(+), 14 deletions(-)
>
> diff --git a/Xext/sync.c b/Xext/sync.c
> index 4140561..5a2e4e5 100644
> --- a/Xext/sync.c
> +++ b/Xext/sync.c
> @@ -984,20 +984,7 @@ SyncCreateSystemCounter(const char *name,
> SyncSystemCounterBracketValues BracketValues
> )
> {
> - SyncCounter *pCounter;
> -
> - /* this function may be called before SYNC has been initialized, so we
> - * have to make sure RTCounter is created.
> - */
> - if (RTCounter == 0) {
> - RTCounter = CreateNewResourceType(FreeCounter, "SyncCounter");
> - if (RTCounter == 0) {
> - return NULL;
> - }
> - xorg_list_init(&SysCounterList);
> - }
> -
> - pCounter = SyncCreateCounter(NULL, FakeClientID(0), initial);
> + SyncCounter *pCounter = SyncCreateCounter(NULL, FakeClientID(0), initial);
>
> if (pCounter) {
> SysCounterInfo *psci;
> --
> 2.5.0
in that case you can remove the RTCounter == 0 check in SyncExtensionInit()
and just do the rest unconditional.
With that, Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
Cheers,
Peter
More information about the xorg-devel
mailing list