Actions
Bug #13598
closedmutex_m: Missing info in the doc
Bug #13598: mutex_m: Missing info in the doc
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
Description
The doc for Mutex_m should remind the user of the necessity of calling super() in each class that includes Mutex_m.
The average user will do:
require 'mutex_m' class A include Mutex_m def initialize myval @myval = myval # error: no super() end def method @myval end end a = A.new 'abc' a.mu_synchronize{a.method} He will get:
NoMethodError: undefined method `synchronize' for nil:NilClass from /usr/lib64/ruby/2.4.0/mutex_m.rb:74:in `mu_synchronize' and will lose the rest of the evening trying to understand what went wrong ;-)
Files
Actions