package org.jruby.internal.runtime.methods;
import org.jruby.RubyModule;
import org.jruby.runtime.Block;
import org.jruby.runtime.ThreadContext;
import org.jruby.runtime.builtin.IRubyObject;
public class SynchronizedDynamicMethod extends DelegatingDynamicMethod {
public SynchronizedDynamicMethod(DynamicMethod delegate) {
super(delegate);
}
@Override
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name) {
synchronized (self) {
return delegate.call(context, self, clazz, name);
}
}
@Override
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0) {
synchronized (self) {
return delegate.call(context, self, clazz, name, arg0);
}
}
@Override
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0, IRubyObject arg1) {
synchronized (self) {
return delegate.call(context, self, clazz, name, arg0, arg1);
}
}
@Override
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2) {
synchronized (self) {
return delegate.call(context, self, clazz, name, arg0, arg1, arg2);
}
}
@Override
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject[] args) {
synchronized (self) {
return delegate.call(context, self, clazz, name, args);
}
}
@Override
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, Block block) {
synchronized (self) {
return delegate.call(context, self, clazz, name, block);
}
}
@Override
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0, Block block) {
synchronized (self) {
return delegate.call(context, self, clazz, name, arg0, block);
}
}
@Override
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0, IRubyObject arg1, Block block) {
synchronized (self) {
return delegate.call(context, self, clazz, name, arg0, arg1, block);
}
}
@Override
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) {
synchronized (self) {
return delegate.call(context, self, clazz, name, arg0, arg1, arg2, block);
}
}
@Override
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject[] args, Block block) {
synchronized (self) {
return delegate.call(context, self, clazz, name, args, block);
}
}
@Override
public DynamicMethod dup() {
return new SynchronizedDynamicMethod(delegate.dup());
}
}