mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parent
5ae2c1b093
commit
3353baac3d
1 changed files with 2 additions and 1 deletions
|
@ -39,11 +39,12 @@ require 'drb/drb'
|
|||
|
||||
module DRbNamedObject
|
||||
DRbNAMEDICT = {}
|
||||
DRBNAMEMUTEX = Thread::Mutex.new
|
||||
attr_reader(:drb_name)
|
||||
|
||||
def drb_name=(name)
|
||||
@drb_name = name
|
||||
Thread.exclusive do
|
||||
DRBNAMEMUTEX.synchronize do
|
||||
raise(IndexError, name) if DRbNAMEDICT[name]
|
||||
DRbNAMEDICT[name] = self
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue