From: KOSAKI Motohiro Date: 2011-09-27T10:28:53+09:00 Subject: [ruby-core:39738] Re: [Ruby 1.9 - Feature #5371][Open] add marshalling support for Mutex > Hello, > > Please add marshalling support for the Mutex class: > > $ irb >>> Marshal.dump(Mutex.new) > TypeError: no marshal_dump is defined for class Mutex > � � � �from (irb):1:in `dump' > � � � �from (irb):1 > � � � �from /usr/bin/irb:12:in `
' Because of, Almost all OSs don't have a way to restore mutex locking state. I have no idea how implement it. ;-) > Here is the workaround I am currently using: > > class Mutex > �def marshal_dump > � �[] > �end > �def marshal_load array > � �# do nothing > �end > end > > Thanks for your consideration. Hmmm?? It seems locking state lost. Is this acceptable?