repo.or.cz
/
ruby-svn.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
* io.c (rb_open_file): encoding in mode string was ignored if perm is
[ruby-svn.git]
/
sample
/
drb
/
namec.rb
blob
f6db6f302219069e9835092c0cd868a74c0389ca
1
=begin
2
distributed Ruby --- NamedObject Sample Client
3
Copyright (c) 2000-2001 Masatoshi SEKI
4
=end
5
6
require 'drb/drb'
7
8
begin
9
there = ARGV.shift || raise
10
rescue
11
puts "usage: #{$0} <server_uri>"
12
exit 1
13
end
14
15
DRb.start_service()
16
ro = DRbObject.new(nil, there)
17
18
seq = ro["seq"]
19
mutex = ro["mutex"]
20
21
p seq
22
p mutex
23
24
mutex.synchronize do
25
p seq.next_value
26
p seq.next_value
27
end
28
29
puts '[return] to continue'
30
gets
31
32
mutex.synchronize do
33
p seq.next_value
34
p seq.next_value
35
end
36