https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112011-09-27T10:29:07ZRuby Issue Tracking SystemRuby master - Feature #5371: add marshalling support for Mutexhttps://redmine.ruby-lang.org/issues/5371?journal_id=210222011-09-27T10:29:07Zkosaki (Motohiro KOSAKI)kosaki.motohiro@gmail.com
<ul></ul><blockquote>
<p>Hello,</p>
<p>Please add marshalling support for the Mutex class:</p>
<p>$ irb</p>
<blockquote>
<blockquote>
<p>Marshal.dump(Mutex.new)<br>
TypeError: no marshal_dump is defined for class Mutex<br>
    from (irb):1:in <code>dump'     from (irb):1     from /usr/bin/irb:12:in </code>'</p>
</blockquote>
</blockquote>
</blockquote>
<p>Because of, Almost all OSs don't have a way to restore mutex locking state.<br>
I have no idea how implement it. ;-)</p>
<blockquote>
<p>Here is the workaround I am currently using:</p>
<p>class Mutex<br>
 def marshal_dump<br>
  []<br>
 end<br>
 def marshal_load array<br>
  # do nothing<br>
 end<br>
end</p>
<p>Thanks for your consideration.</p>
</blockquote>
<p>Hmmm??<br>
It seems locking state lost. Is this acceptable?</p> Ruby master - Feature #5371: add marshalling support for Mutexhttps://redmine.ruby-lang.org/issues/5371?journal_id=252182012-03-27T03:24:24Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Rejected</i></li></ul><p>There is no feedback or revised proposal from OP.<br>
I close this as Rejected.</p>
<p>--<br>
Yusuke Endoh <a href="mailto:mame@tsg.ne.jp" class="email">mame@tsg.ne.jp</a></p>