summaryrefslogtreecommitdiff
path: root/prelude.rb
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-24 15:26:28 (GMT)
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-24 15:26:28 (GMT)
commit6bf7d3d8c08dbd96ec485bb856cb739139e720bc (patch)
tree25b681e65b65ea04b8748ba31cb8afb6e2f56d32 /prelude.rb
parentb285d26a16c90f8e2d491592e793c3b40545aaf1 (diff)
* prelude.rb: added. run this script on startup.
* tool/compile_prelude.rb: compile prelude.rb to C string. (prelude.rb -> prelude.c) * common.mk: fix to build with prelude.c. * inits.c (rb_call_inits): ditto. * thread.c (Init_Thread): move definition of Mutex#synchronize to prelude.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'prelude.rb')
-rw-r--r--prelude.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/prelude.rb b/prelude.rb
new file mode 100644
index 0000000..423c9c4
--- /dev/null
+++ b/prelude.rb
@@ -0,0 +1,14 @@
+
+# Mutex
+
+class Mutex
+ class Mutex
+ def synchronize
+ self.lock
+ yield
+ ensure
+ self.unlock
+ end
+ end
+end
+