commit | 1f5b95ff7d34f244e6ea1e7a5c94581de99891eb | [log] [tgz] |
---|---|---|
author | Matt Buckley <mattbuckley@google.com> | Fri Jun 07 02:36:56 2024 +0000 |
committer | Matt Buckley <mattbuckley@google.com> | Fri Jun 07 02:46:41 2024 +0000 |
tree | b619ae1d5dbffaf24be25d91187d8bee32fa68d7 | |
parent | 7d217a8ab7919adec8e1c2e13ef290091650d65b [diff] |
Add locking to performance hint NDK This patch adds thread safety to the NDK, locking everything behind a single mutex to avoid multiple lock acquisitions when operating on shared state. All calls are asynchronous, except for createSession and setThreads which don't need to hold the lock during their call, so the risk of contesting the mutex is low. Test: atest PerformanceHintNativeTest Bug: 343817997 Change-Id: Ib08c11d6b7c84c30e83cca6613b15c62bcd8a68f