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

Commit c789c905 authored by Vishnu Nair's avatar Vishnu Nair Committed by Android (Google) Code Review
Browse files

Merge "Grab the tracing lock before calling the trace runner" into sc-dev

parents 30230614 c96ad66d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -71,12 +71,14 @@ status_t SurfaceTracing::writeToFile() {
}

void SurfaceTracing::notify(const char* where) {
    std::scoped_lock lock(mTraceLock);
    if (mEnabled) {
        runner->notify(where);
    }
}

void SurfaceTracing::notifyLocked(const char* where) {
    std::scoped_lock lock(mTraceLock);
    if (mEnabled) {
        runner->notifyLocked(where);
    }
+2 −2
Original line number Diff line number Diff line
@@ -81,8 +81,8 @@ private:

    SurfaceFlinger& mFlinger;
    mutable std::mutex mTraceLock;
    bool mEnabled = false;
    std::unique_ptr<Runner> runner;
    bool mEnabled GUARDED_BY(mTraceLock) = false;
    std::unique_ptr<Runner> runner GUARDED_BY(mTraceLock);

    struct Config {
        uint32_t flags = TRACE_CRITICAL | TRACE_INPUT | TRACE_SYNC;