Fixed
Status Update
Comments
ky...@bytedance.com <ky...@bytedance.com> #2
Tried with "4.0.0-alpha09" and still same error.
rk...@google.com <rk...@google.com>
rk...@google.com <rk...@google.com> #3
Thank you for filing the issue. This regression is introduced while fixing https://issuetracker.google.com/119135578 . CL that introduced it ag/I3c6dbc840a573a78ad414b37ed3e6fcb42dd78b6.
In order to work around this issue, please add "android.jetifier.skipIfPossible=false" to gradle.properties.
Filip, is this something that can be fixed on the Jetifier side, or we need to revert ag/I3c6dbc840a573a78ad414b37ed3e6fcb42dd78b6?
In order to work around this issue, please add "android.jetifier.skipIfPossible=false" to gradle.properties.
Filip, is this something that can be fixed on the Jetifier side, or we need to revert ag/I3c6dbc840a573a78ad414b37ed3e6fcb42dd78b6?
rk...@google.com <rk...@google.com> #4
Hung, can you please help why is this happening? Is this because jetifier fails to detect support reference or there is something else?
Description
AutoLock
appears to be a custom implementation ofstd::unique_lock/lock_guard
. It does, however, a method namedisLocked()
. There is only one use of the method at the moment:I believe, that has room for improvement. Firstly, even if we checked
isLock()
in general, asisLock()
is not thread-safe, there is no guarantee (in general) that the same thread can then lock it. It is only useful when there is only one thread that locks/unlocks the givenAutoLock
object and the thread wants know whether thelock
is acquired or not by itself. I don't think that's useful. I think the method being public, it has a good chance to confuse external developers.My belief is that the
AutoLock
should be simply replaced withstd::unique_lock
and/orstd::lock_guard
, as many uses of the class do not calllock
orunlock
. And,isLocked()
should be removed. The only call site should be implemented without that.Aside from all mentioned above, I am trying to compile the code with
--enable-thread-safety-checks
, and the first code that blocked the compilation on Linux was the use ofisLocked()
.