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

Commit 38dc306f authored by Patrick Baumann's avatar Patrick Baumann Committed by Android (Google) Code Review
Browse files

Merge "Fix parallelNoCache perf test" into sc-dev

parents 60104529 cdce73aa
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -159,7 +159,15 @@ class PackageParsingPerfTest {
            PARALLEL_MAX_THREADS, "package-parsing-test",
            Process.THREAD_PRIORITY_FOREGROUND)

        fun submit(file: File) = service.submit { queue.put(parse(file)) }
        fun submit(file: File) {
                service.submit {
                    try {
                        queue.put(parse(file))
                    } catch (e: Exception) {
                        queue.put(e)
                    }
                }
        }

        fun take() = queue.poll(QUEUE_POLL_TIMEOUT_SECONDS, TimeUnit.SECONDS)