Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Thread#initialize should raise a ThreadError when already initialized #689

Merged
merged 1 commit into from

2 participants

@atambo
Collaborator

No description provided.

@headius headius merged commit c01124e into jruby:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
1  spec/tags/1.8/ruby/core/thread/initialize_tags.txt
@@ -1 +0,0 @@
-fails:Thread#initialize already initialized raises a ThreadError
View
1  spec/tags/1.9/ruby/core/thread/initialize_tags.txt
@@ -1 +0,0 @@
-fails:Thread#initialize already initialized raises a ThreadError
View
1  src/org/jruby/RubyThread.java
@@ -421,6 +421,7 @@ private static RubyThread adoptThread(final IRubyObject recv, Thread t, Block bl
public IRubyObject initialize(ThreadContext context, IRubyObject[] args, Block block) {
Ruby runtime = getRuntime();
if (!block.isGiven()) throw runtime.newThreadError("must be called with a block");
+ if (threadImpl != null) throw runtime.newThreadError("already initialized thread");
try {
RubyRunnable runnable = new RubyRunnable(this, args, context.getFrames(0), block);
Something went wrong with that request. Please try again.