Reputation: 15217
I have a class that contains an object of type Object
(which is used as a monitor for synchronization). Since Object
s are not Serializable
, what can I substitute to make serialization work?
Upvotes: 2
Views: 330
Reputation: 11686
A monitor for synchronization? Have you tried with ReentrantLock
Like Jonathon said. You should mark it as transient
Upvotes: 0
Reputation: 12545
I wouldn't think a field used for synchronization would need to be serialized.
Mark it transient
.
Upvotes: 10