Class: SyncArray
Instance Attribute Summary collapse
Instance Method Summary
collapse
#restore_snapshot, #take_snapshot
Constructor Details
#initialize(delegator = nil) ⇒ SyncArray
gmosx: delegator is not yet used.
45
46
47
48
|
# File 'lib/mega/syncarray.rb', line 45
def initialize(delegator = nil)
@sync = ::Sync.new()
super()
end
|
Instance Attribute Details
Returns the value of attribute sync.
40
41
42
|
# File 'lib/mega/syncarray.rb', line 40
def sync
@sync
end
|
Instance Method Details
#<<(value) ⇒ Object
50
51
52
|
# File 'lib/mega/syncarray.rb', line 50
def << (value)
return @sync.synchronize(Sync::SH) { super }
end
|
58
59
60
|
# File 'lib/mega/syncarray.rb', line 58
def [](key)
return @sync.synchronize(Sync::SH) { super }
end
|
#[]=(key, value) ⇒ Object
62
63
64
|
# File 'lib/mega/syncarray.rb', line 62
def []=(key, value)
return @sync.synchronize(Sync::EX) { super }
end
|
70
71
72
|
# File 'lib/mega/syncarray.rb', line 70
def clear
@sync.synchronize(Sync::EX) { super }
end
|
#delete(key) ⇒ Object
66
67
68
|
# File 'lib/mega/syncarray.rb', line 66
def delete(key)
return @sync.synchronize(Sync::EX) { super }
end
|
#delete_if(&block) ⇒ Object
54
55
56
|
# File 'lib/mega/syncarray.rb', line 54
def delete_if(&block)
return @sync.synchronize(Sync::SH) { super }
end
|
78
79
80
|
# File 'lib/mega/syncarray.rb', line 78
def shift
return @sync.synchronize(::Sync::EX) { super }
end
|
74
75
76
|
# File 'lib/mega/syncarray.rb', line 74
def size
return @sync.synchronize(Sync::SH) { super }
end
|
#unshift(el) ⇒ Object
82
83
84
|
# File 'lib/mega/syncarray.rb', line 82
def unshift(el)
return @sync.synchronize(::Sync::EX) { super }
end
|