Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8dce3633 authored by Flamefire's avatar Flamefire
Browse files

Fix crash on boot

There is a race condition where the sysfs-vsync thread accesses a value
(in particular a function ptr) that may not have been set yet as this
is done externally.

Change-Id: If1afb1533344e994398b9b6f5bd3dfb125313416
parent 51af4fcc
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -965,6 +965,7 @@ static void *hwc_vsync_sysfs_loop(void *data)
    do {
        ssize_t len = read(vsync_timestamp_fd, buf, sizeof(buf));
        timestamp = strtoull(buf, NULL, 0);
        if(ctx->procs && ctx->procs->vsync)
            ctx->procs->vsync(ctx->procs, 0, timestamp);
        select(vsync_timestamp_fd + 1, NULL, NULL, &exceptfds, NULL);
        lseek(vsync_timestamp_fd, 0, SEEK_SET);