summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-08 07:00:01 (GMT)
committerkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-08 07:00:01 (GMT)
commit6064132c42ffe99e9a0d3a6ba80a7932c6f7903d (patch)
tree98ea21370a09a06240cd88eef3320ef565240e02
parent838a91633c3a50f43bcc4ccec11b41b5a102fd90 (diff)
Remove unnecessary `require 'thread'`
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--lib/drb/drb.rb1
-rw-r--r--lib/drb/extservm.rb1
-rw-r--r--lib/irb/ext/multi-irb.rb1
-rw-r--r--lib/irb/workspace.rb2
-rw-r--r--lib/monitor.rb2
-rw-r--r--lib/mutex_m.rb3
-rw-r--r--lib/rinda/rinda.rb1
-rw-r--r--lib/rinda/ring.rb1
-rw-r--r--lib/rinda/tuplespace.rb1
-rw-r--r--lib/shell/command-processor.rb1
-rw-r--r--lib/shell/process-controller.rb2
-rw-r--r--lib/singleton.rb1
-rw-r--r--lib/thwait.rb1
-rw-r--r--lib/tracer.rb1
-rw-r--r--lib/webrick/httpservlet/abstract.rb2
-rw-r--r--lib/webrick/httpservlet/filehandler.rb1
-rw-r--r--lib/webrick/server.rb1
-rw-r--r--lib/webrick/utils.rb1
-rw-r--r--sample/drb/dchats.rb1
-rw-r--r--sample/drb/dhasen.rb1
-rw-r--r--sample/drb/dlogd.rb1
-rw-r--r--sample/drb/dqueue.rb1
-rw-r--r--sample/drb/http0serv.rb1
-rw-r--r--sample/drb/name.rb1
-rw-r--r--sample/drb/old_tuplespace.rb2
-rw-r--r--sample/drb/ring_echo.rb1
-rw-r--r--sample/drb/simpletuple.rb2
-rw-r--r--sample/dualstack-httpd.rb1
-rw-r--r--sample/observ.rb1
-rw-r--r--sample/philos.rb1
-rw-r--r--test/-ext-/postponed_job/test_postponed_job.rb1
-rw-r--r--test/bigdecimal/test_bigdecimal.rb2
-rw-r--r--test/lib/test/unit.rb3
-rw-r--r--test/monitor/test_monitor.rb1
-rw-r--r--test/ruby/lbtest.rb1
-rw-r--r--test/ruby/test_autoload.rb1
-rw-r--r--test/ruby/test_backtrace.rb1
-rw-r--r--test/ruby/test_file.rb1
-rw-r--r--test/ruby/test_thread.rb2
-rw-r--r--test/ruby/test_threadgroup.rb1
-rw-r--r--test/socket/test_unix.rb1
-rw-r--r--test/test_mutex_m.rb1
-rw-r--r--test/test_tempfile.rb1
-rw-r--r--test/test_timeout.rb1
-rw-r--r--test/thread/test_cv.rb3
-rw-r--r--test/thread/test_queue.rb2
-rw-r--r--thread_sync.c6
47 files changed, 2 insertions, 65 deletions
diff --git a/lib/drb/drb.rb b/lib/drb/drb.rb
index 38cb385..1d654b3 100644
--- a/lib/drb/drb.rb
+++ b/lib/drb/drb.rb
@@ -47,7 +47,6 @@
# Translation of presentation on Ruby by Masatoshi Seki.
require 'socket'
-require 'thread'
require 'io/wait'
require 'drb/eq'
diff --git a/lib/drb/extservm.rb b/lib/drb/extservm.rb
index 7e70a3c..5d779f5 100644
--- a/lib/drb/extservm.rb
+++ b/lib/drb/extservm.rb
@@ -5,7 +5,6 @@
=end
require 'drb/drb'
-require 'thread'
require 'monitor'
module DRb
diff --git a/lib/irb/ext/multi-irb.rb b/lib/irb/ext/multi-irb.rb
index 982a319..28d6fba 100644
--- a/lib/irb/ext/multi-irb.rb
+++ b/lib/irb/ext/multi-irb.rb
@@ -10,7 +10,6 @@
#
#
IRB.fail CantShiftToMultiIrbMode unless defined?(Thread)
-require "thread"
module IRB
class JobManager
diff --git a/lib/irb/workspace.rb b/lib/irb/workspace.rb
index 16f714d..9051f96 100644
--- a/lib/irb/workspace.rb
+++ b/lib/irb/workspace.rb
@@ -39,8 +39,6 @@ EOF
when 2 # binding in loaded file(thread use)
unless defined? BINDING_QUEUE
- require "thread"
-
IRB.const_set(:BINDING_QUEUE, Thread::SizedQueue.new(1))
Thread.abort_on_exception = true
Thread.start do
diff --git a/lib/monitor.rb b/lib/monitor.rb
index cbc1a13..288ed75 100644
--- a/lib/monitor.rb
+++ b/lib/monitor.rb
@@ -7,8 +7,6 @@
# You can freely distribute/modify this library.
#
-require 'thread'
-
#
# In concurrent programming, a monitor is an object or module intended to be
# used safely by more than one thread. The defining characteristic of a
diff --git a/lib/mutex_m.rb b/lib/mutex_m.rb
index a8472f1..592e384 100644
--- a/lib/mutex_m.rb
+++ b/lib/mutex_m.rb
@@ -10,9 +10,6 @@
#
# --
-
-require 'thread'
-
# = mutex_m.rb
#
# When 'mutex_m' is required, any object that extends or includes Mutex_m will
diff --git a/lib/rinda/rinda.rb b/lib/rinda/rinda.rb
index 36c3503..e762286 100644
--- a/lib/rinda/rinda.rb
+++ b/lib/rinda/rinda.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: false
require 'drb/drb'
-require 'thread'
##
# A module to implement the Linda distributed computing paradigm in Ruby.
diff --git a/lib/rinda/ring.rb b/lib/rinda/ring.rb
index d82ecab..34dc245 100644
--- a/lib/rinda/ring.rb
+++ b/lib/rinda/ring.rb
@@ -4,7 +4,6 @@
#
require 'drb/drb'
require 'rinda/rinda'
-require 'thread'
require 'ipaddr'
module Rinda
diff --git a/lib/rinda/tuplespace.rb b/lib/rinda/tuplespace.rb
index 3ce8d29..47860bc 100644
--- a/lib/rinda/tuplespace.rb
+++ b/lib/rinda/tuplespace.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: false
require 'monitor'
-require 'thread'
require 'drb/drb'
require 'rinda/rinda'
require 'forwardable'
diff --git a/lib/shell/command-processor.rb b/lib/shell/command-processor.rb
index 32c461e..b52cb00 100644
--- a/lib/shell/command-processor.rb
+++ b/lib/shell/command-processor.rb
@@ -11,7 +11,6 @@
#
require "e2mmap"
-require "thread"
require "shell/error"
require "shell/filter"
diff --git a/lib/shell/process-controller.rb b/lib/shell/process-controller.rb
index 7e5bb50..d54da68 100644
--- a/lib/shell/process-controller.rb
+++ b/lib/shell/process-controller.rb
@@ -10,8 +10,6 @@
#
#
require "forwardable"
-
-require "thread"
require "sync"
class Shell
diff --git a/lib/singleton.rb b/lib/singleton.rb
index deb0f52..368febc 100644
--- a/lib/singleton.rb
+++ b/lib/singleton.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: false
-require 'thread'
# The Singleton module implements the Singleton pattern.
#
diff --git a/lib/thwait.rb b/lib/thwait.rb
index 239915b..8f9e0c2 100644
--- a/lib/thwait.rb
+++ b/lib/thwait.rb
@@ -5,7 +5,6 @@
# $Revision: 1.3 $
# by Keiju ISHITSUKA(Nihon Rational Software Co.,Ltd.)
-require "thread.rb"
require "e2mmap.rb"
#
diff --git a/lib/tracer.rb b/lib/tracer.rb
index 24a5313..faafd80 100644
--- a/lib/tracer.rb
+++ b/lib/tracer.rb
@@ -2,7 +2,6 @@
#--
# $Release Version: 0.3$
# $Revision: 1.12 $
-require "thread"
##
# Outputs a source level execution trace of a Ruby program.
diff --git a/lib/webrick/httpservlet/abstract.rb b/lib/webrick/httpservlet/abstract.rb
index ee558eb..fc4cd22 100644
--- a/lib/webrick/httpservlet/abstract.rb
+++ b/lib/webrick/httpservlet/abstract.rb
@@ -9,8 +9,6 @@
#
# $IPR: abstract.rb,v 1.24 2003/07/11 11:16:46 gotoyuzo Exp $
-require 'thread'
-
require 'webrick/htmlutils'
require 'webrick/httputils'
require 'webrick/httpstatus'
diff --git a/lib/webrick/httpservlet/filehandler.rb b/lib/webrick/httpservlet/filehandler.rb
index cf37dd6..3ea1eec 100644
--- a/lib/webrick/httpservlet/filehandler.rb
+++ b/lib/webrick/httpservlet/filehandler.rb
@@ -9,7 +9,6 @@
#
# $IPR: filehandler.rb,v 1.44 2003/06/07 01:34:51 gotoyuzo Exp $
-require 'thread'
require 'time'
require 'webrick/htmlutils'
diff --git a/lib/webrick/server.rb b/lib/webrick/server.rb
index 00fa3b1..fad5346 100644
--- a/lib/webrick/server.rb
+++ b/lib/webrick/server.rb
@@ -9,7 +9,6 @@
#
# $IPR: server.rb,v 1.62 2003/07/22 19:20:43 gotoyuzo Exp $
-require 'thread'
require 'socket'
require 'webrick/config'
require 'webrick/log'
diff --git a/lib/webrick/utils.rb b/lib/webrick/utils.rb
index 8b34b66..68833af 100644
--- a/lib/webrick/utils.rb
+++ b/lib/webrick/utils.rb
@@ -91,7 +91,6 @@ module WEBrick
###########
- require "thread"
require "timeout"
require "singleton"
diff --git a/sample/drb/dchats.rb b/sample/drb/dchats.rb
index c07f748..58af3cf 100644
--- a/sample/drb/dchats.rb
+++ b/sample/drb/dchats.rb
@@ -2,7 +2,6 @@
distributed Ruby --- chat server
Copyright (c) 1999-2000 Masatoshi SEKI
=end
-require 'thread'
require 'drb/drb'
class ChatEntry
diff --git a/sample/drb/dhasen.rb b/sample/drb/dhasen.rb
index 9ab8534..13ff389 100644
--- a/sample/drb/dhasen.rb
+++ b/sample/drb/dhasen.rb
@@ -17,7 +17,6 @@
require 'drb/drb'
require 'chasen'
-require 'thread'
class Dhasen
include DRbUndumped
diff --git a/sample/drb/dlogd.rb b/sample/drb/dlogd.rb
index be36451..a87e660 100644
--- a/sample/drb/dlogd.rb
+++ b/sample/drb/dlogd.rb
@@ -4,7 +4,6 @@
=end
require 'drb/drb'
-require 'thread'
class Logger
def initialize(fname)
diff --git a/sample/drb/dqueue.rb b/sample/drb/dqueue.rb
index 1a405f5..a9afa8c 100644
--- a/sample/drb/dqueue.rb
+++ b/sample/drb/dqueue.rb
@@ -3,7 +3,6 @@
Copyright (c) 1999-2000 Masatoshi SEKI
=end
-require 'thread'
require 'drb/drb'
DRb.start_service(nil, Thread::Queue.new)
diff --git a/sample/drb/http0serv.rb b/sample/drb/http0serv.rb
index 049f5a1..1a58811 100644
--- a/sample/drb/http0serv.rb
+++ b/sample/drb/http0serv.rb
@@ -1,7 +1,6 @@
require 'webrick'
require 'drb/drb'
require 'drb/http0'
-require 'thread'
module DRb
module HTTP0
diff --git a/sample/drb/name.rb b/sample/drb/name.rb
index 30c902b..a8ad287 100644
--- a/sample/drb/name.rb
+++ b/sample/drb/name.rb
@@ -35,7 +35,6 @@ How to play.
| 2
=end
-require 'thread.rb'
require 'drb/drb'
module DRbNamedObject
diff --git a/sample/drb/old_tuplespace.rb b/sample/drb/old_tuplespace.rb
index 9c10a34..8be1542 100644
--- a/sample/drb/old_tuplespace.rb
+++ b/sample/drb/old_tuplespace.rb
@@ -3,8 +3,6 @@
# Copyright (c) 1999-2000 Masatoshi SEKI
# You can redistribute it and/or modify it under the same terms as Ruby.
-require 'thread'
-
class TupleSpace
class Template
def initialize(list)
diff --git a/sample/drb/ring_echo.rb b/sample/drb/ring_echo.rb
index 3b743ca..c54628b 100644
--- a/sample/drb/ring_echo.rb
+++ b/sample/drb/ring_echo.rb
@@ -1,7 +1,6 @@
require 'drb/drb'
require 'drb/eq'
require 'rinda/ring'
-require 'thread'
class RingEcho
include DRbUndumped
diff --git a/sample/drb/simpletuple.rb b/sample/drb/simpletuple.rb
index bfbd86e..4bb4b1c 100644
--- a/sample/drb/simpletuple.rb
+++ b/sample/drb/simpletuple.rb
@@ -3,8 +3,6 @@
# Copyright (c) 1999-2000 Masatoshi SEKI
# You can redistribute it and/or modify it under the same terms as Ruby.
-require 'thread'
-
class SimpleTupleSpace
def initialize
@hash = {}
diff --git a/sample/dualstack-httpd.rb b/sample/dualstack-httpd.rb
index a6d4d3a..ab02e17 100644
--- a/sample/dualstack-httpd.rb
+++ b/sample/dualstack-httpd.rb
@@ -3,7 +3,6 @@
# The code demonstrates how a multi-protocol daemon should be written.
require "socket"
-require "thread"
port = 8888
res = Socket.getaddrinfo(nil, port, nil, Socket::SOCK_STREAM, nil, Socket::AI_PASSIVE)
diff --git a/sample/observ.rb b/sample/observ.rb
index 061e3c6..a7ea452 100644
--- a/sample/observ.rb
+++ b/sample/observ.rb
@@ -1,6 +1,5 @@
#! /usr/local/bin/ruby
-require "thread"
require "observer"
class Tick
diff --git a/sample/philos.rb b/sample/philos.rb
index 622e58b..c38aa4a 100644
--- a/sample/philos.rb
+++ b/sample/philos.rb
@@ -1,7 +1,6 @@
#
# The Dining Philosophers - thread example
#
-require "thread"
srand
#srand
diff --git a/test/-ext-/postponed_job/test_postponed_job.rb b/test/-ext-/postponed_job/test_postponed_job.rb
index da3b579..978b728 100644
--- a/test/-ext-/postponed_job/test_postponed_job.rb
+++ b/test/-ext-/postponed_job/test_postponed_job.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: false
require 'test/unit'
-require 'thread'
require '-test-/postponed_job'
module Bug
diff --git a/test/bigdecimal/test_bigdecimal.rb b/test/bigdecimal/test_bigdecimal.rb
index 1becaf8..7b2bc76 100644
--- a/test/bigdecimal/test_bigdecimal.rb
+++ b/test/bigdecimal/test_bigdecimal.rb
@@ -2,8 +2,6 @@
require_relative "testbase"
require 'bigdecimal/math'
-require 'thread'
-
class TestBigDecimal < Test::Unit::TestCase
include TestBigDecimalBase
diff --git a/test/lib/test/unit.rb b/test/lib/test/unit.rb
index c280c68..afdd5de 100644
--- a/test/lib/test/unit.rb
+++ b/test/lib/test/unit.rb
@@ -452,8 +452,7 @@ module Test
return
end
- # Require needed things for parallel running
- require 'thread'
+ # Require needed thing for parallel running
require 'timeout'
@tasks = @files.dup # Array of filenames.
@need_quit = false
diff --git a/test/monitor/test_monitor.rb b/test/monitor/test_monitor.rb
index ca45602..a036069 100644
--- a/test/monitor/test_monitor.rb
+++ b/test/monitor/test_monitor.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: false
require "monitor"
-require "thread"
require "test/unit"
diff --git a/test/ruby/lbtest.rb b/test/ruby/lbtest.rb
index 208c8b2..c7822c9 100644
--- a/test/ruby/lbtest.rb
+++ b/test/ruby/lbtest.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: false
-require 'thread'
class LocalBarrier
def initialize(n)
diff --git a/test/ruby/test_autoload.rb b/test/ruby/test_autoload.rb
index 961825e..9d16a45 100644
--- a/test/ruby/test_autoload.rb
+++ b/test/ruby/test_autoload.rb
@@ -1,7 +1,6 @@
# frozen_string_literal: false
require 'test/unit'
require 'tempfile'
-require 'thread'
class TestAutoload < Test::Unit::TestCase
def test_autoload_so
diff --git a/test/ruby/test_backtrace.rb b/test/ruby/test_backtrace.rb
index ec6e058..d38628c 100644
--- a/test/ruby/test_backtrace.rb
+++ b/test/ruby/test_backtrace.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: false
require 'test/unit'
-require 'thread'
require 'tempfile'
class TestBacktrace < Test::Unit::TestCase
diff --git a/test/ruby/test_file.rb b/test/ruby/test_file.rb
index a184d34..4be4e86 100644
--- a/test/ruby/test_file.rb
+++ b/test/ruby/test_file.rb
@@ -1,7 +1,6 @@
# frozen_string_literal: false
require 'test/unit'
require 'tempfile'
-require "thread"
require "-test-/file"
require_relative 'ut_eof'
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb
index 12acedf..6e2f594 100644
--- a/test/ruby/test_thread.rb
+++ b/test/ruby/test_thread.rb
@@ -1,7 +1,6 @@
# -*- coding: us-ascii -*-
# frozen_string_literal: false
require 'test/unit'
-require 'thread'
class TestThread < Test::Unit::TestCase
class Thread < ::Thread
@@ -966,7 +965,6 @@ _eom
def test_main_thread_status_at_exit
assert_in_out_err([], <<-'INPUT', ["false false aborting"], [])
-require 'thread'
q = Thread::Queue.new
Thread.new(Thread.current) {|mth|
begin
diff --git a/test/ruby/test_threadgroup.rb b/test/ruby/test_threadgroup.rb
index 80b0c15..ec95bd6 100644
--- a/test/ruby/test_threadgroup.rb
+++ b/test/ruby/test_threadgroup.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: false
require 'test/unit'
-require 'thread'
class TestThreadGroup < Test::Unit::TestCase
def test_thread_init
diff --git a/test/socket/test_unix.rb b/test/socket/test_unix.rb
index 7edb5e5..36f48c3 100644
--- a/test/socket/test_unix.rb
+++ b/test/socket/test_unix.rb
@@ -9,7 +9,6 @@ require "test/unit"
require "tempfile"
require "timeout"
require "tmpdir"
-require "thread"
require "io/nonblock"
class TestSocket_UNIXSocket < Test::Unit::TestCase
diff --git a/test/test_mutex_m.rb b/test/test_mutex_m.rb
index 0365265..30971dd 100644
--- a/test/test_mutex_m.rb
+++ b/test/test_mutex_m.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: false
require 'test/unit'
-require 'thread'
require 'mutex_m'
class TestMutexM < Test::Unit::TestCase
diff --git a/test/test_tempfile.rb b/test/test_tempfile.rb
index 8973051..465ce42 100644
--- a/test/test_tempfile.rb
+++ b/test/test_tempfile.rb
@@ -1,7 +1,6 @@
# frozen_string_literal: true
require 'test/unit'
require 'tempfile'
-require 'thread'
class TestTempfile < Test::Unit::TestCase
def initialize(*)
diff --git a/test/test_timeout.rb b/test/test_timeout.rb
index 09073e9..c57d90c 100644
--- a/test/test_timeout.rb
+++ b/test/test_timeout.rb
@@ -1,7 +1,6 @@
# frozen_string_literal: false
require 'test/unit'
require 'timeout'
-require 'thread'
class TestTimeout < Test::Unit::TestCase
def test_queue
diff --git a/test/thread/test_cv.rb b/test/thread/test_cv.rb
index 7a34d74..7024626 100644
--- a/test/thread/test_cv.rb
+++ b/test/thread/test_cv.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: false
require 'test/unit'
-require 'thread'
require 'tmpdir'
class TestConditionVariable < Test::Unit::TestCase
@@ -94,8 +93,6 @@ class TestConditionVariable < Test::Unit::TestCase
def test_condvar_wait_deadlock
assert_in_out_err([], <<-INPUT, /\Afatal\nNo live threads left\. Deadlock/, [])
- require "thread"
-
mutex = Mutex.new
cv = ConditionVariable.new
diff --git a/test/thread/test_queue.rb b/test/thread/test_queue.rb
index 300ffd7..56cded8 100644
--- a/test/thread/test_queue.rb
+++ b/test/thread/test_queue.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: false
require 'test/unit'
-require 'thread'
require 'tmpdir'
require 'timeout'
@@ -136,7 +135,6 @@ class TestQueue < Test::Unit::TestCase
total_count = 250
begin
assert_normal_exit(<<-"_eom", bug5343, {:timeout => timeout, :chdir=>d})
- require "thread"
#{total_count}.times do |i|
open("test_thr_kill_count", "w") {|f| f.puts i }
queue = Queue.new
diff --git a/thread_sync.c b/thread_sync.c
index 95f48ad..3316bcb 100644
--- a/thread_sync.c
+++ b/thread_sync.c
@@ -65,7 +65,6 @@ static const char* rb_mutex_unlock_th(rb_mutex_t *mutex, rb_thread_t volatile *t
*
* Example:
*
- * require 'thread'
* semaphore = Mutex.new
*
* a = Thread.new {
@@ -673,8 +672,7 @@ queue_closed_result(VALUE self, struct rb_queue *q)
*
* Example:
*
- * require 'thread'
- * queue = Queue.new
+ * queue = Queue.new
*
* producer = Thread.new do
* 5.times do |i|
@@ -1211,8 +1209,6 @@ struct rb_condvar {
*
* Example:
*
- * require 'thread'
- *
* mutex = Mutex.new
* resource = ConditionVariable.new
*