-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This let us move away from the current hack (which was never in a Guava _release_) of using a lock of `new Integer(1)` (because we needed something `Serializable` while we figured this all out). RELNOTES=n/a PiperOrigin-RevId: 659714359
- Loading branch information
Showing
2 changed files
with
44 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5f0e886
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using Object[0] as your lock object should mean you don’t have to customize the serialization since it’s handled specifically. It’s a leaner and safer trick.
5f0e886
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha, thanks, @ben-manes! As it happens, this commit is also trying to accommodate a couple pieces of Google-internal weirdness, so if it sticks, I am going to leave it alone, especially given the chance that we someday further rework it to temporarily address thread pinning for testing purposes after all. However, I also have another commit on the way to address some tests that need
Serializable
monitors, so I will be reworking that to useObject[0]
instead of the customSerializableMonitor
class that I'd been planning to introduce.