Skip to content

Commit

Permalink
Remove unnecessary require 'thread'
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
znz committed Oct 8, 2017
1 parent 838a916 commit 6064132
Show file tree
Hide file tree
Showing 47 changed files with 2 additions and 65 deletions.
1 change: 0 additions & 1 deletion lib/drb/drb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
# Translation of presentation on Ruby by Masatoshi Seki.

require 'socket'
require 'thread'
require 'io/wait'
require 'drb/eq'

Expand Down
1 change: 0 additions & 1 deletion lib/drb/extservm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
=end

require 'drb/drb'
require 'thread'
require 'monitor'

module DRb
Expand Down
1 change: 0 additions & 1 deletion lib/irb/ext/multi-irb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#
#
IRB.fail CantShiftToMultiIrbMode unless defined?(Thread)
require "thread"

module IRB
class JobManager
Expand Down
2 changes: 0 additions & 2 deletions lib/irb/workspace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ def initialize(*main)

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
Expand Down
2 changes: 0 additions & 2 deletions lib/monitor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions lib/mutex_m.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
#
# --


require 'thread'

# = mutex_m.rb
#
# When 'mutex_m' is required, any object that extends or includes Mutex_m will
Expand Down
1 change: 0 additions & 1 deletion lib/rinda/rinda.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: false
require 'drb/drb'
require 'thread'

##
# A module to implement the Linda distributed computing paradigm in Ruby.
Expand Down
1 change: 0 additions & 1 deletion lib/rinda/ring.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#
require 'drb/drb'
require 'rinda/rinda'
require 'thread'
require 'ipaddr'

module Rinda
Expand Down
1 change: 0 additions & 1 deletion lib/rinda/tuplespace.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: false
require 'monitor'
require 'thread'
require 'drb/drb'
require 'rinda/rinda'
require 'forwardable'
Expand Down
1 change: 0 additions & 1 deletion lib/shell/command-processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#

require "e2mmap"
require "thread"

require "shell/error"
require "shell/filter"
Expand Down
2 changes: 0 additions & 2 deletions lib/shell/process-controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
#
#
require "forwardable"

require "thread"
require "sync"

class Shell
Expand Down
1 change: 0 additions & 1 deletion lib/singleton.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# frozen_string_literal: false
require 'thread'

# The Singleton module implements the Singleton pattern.
#
Expand Down
1 change: 0 additions & 1 deletion lib/thwait.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# $Revision: 1.3 $
# by Keiju ISHITSUKA(Nihon Rational Software Co.,Ltd.)

require "thread.rb"
require "e2mmap.rb"

#
Expand Down
1 change: 0 additions & 1 deletion lib/tracer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#--
# $Release Version: 0.3$
# $Revision: 1.12 $
require "thread"

##
# Outputs a source level execution trace of a Ruby program.
Expand Down
2 changes: 0 additions & 2 deletions lib/webrick/httpservlet/abstract.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
1 change: 0 additions & 1 deletion lib/webrick/httpservlet/filehandler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
1 change: 0 additions & 1 deletion lib/webrick/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
1 change: 0 additions & 1 deletion lib/webrick/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ def random_string(len)

###########

require "thread"
require "timeout"
require "singleton"

Expand Down
1 change: 0 additions & 1 deletion sample/drb/dchats.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
distributed Ruby --- chat server
Copyright (c) 1999-2000 Masatoshi SEKI
=end
require 'thread'
require 'drb/drb'

class ChatEntry
Expand Down
1 change: 0 additions & 1 deletion sample/drb/dhasen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

require 'drb/drb'
require 'chasen'
require 'thread'

class Dhasen
include DRbUndumped
Expand Down
1 change: 0 additions & 1 deletion sample/drb/dlogd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
=end

require 'drb/drb'
require 'thread'

class Logger
def initialize(fname)
Expand Down
1 change: 0 additions & 1 deletion sample/drb/dqueue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
Copyright (c) 1999-2000 Masatoshi SEKI
=end

require 'thread'
require 'drb/drb'

DRb.start_service(nil, Thread::Queue.new)
Expand Down
1 change: 0 additions & 1 deletion sample/drb/http0serv.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'webrick'
require 'drb/drb'
require 'drb/http0'
require 'thread'

module DRb
module HTTP0
Expand Down
1 change: 0 additions & 1 deletion sample/drb/name.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
| 2
=end

require 'thread.rb'
require 'drb/drb'

module DRbNamedObject
Expand Down
2 changes: 0 additions & 2 deletions sample/drb/old_tuplespace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion sample/drb/ring_echo.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'drb/drb'
require 'drb/eq'
require 'rinda/ring'
require 'thread'

class RingEcho
include DRbUndumped
Expand Down
2 changes: 0 additions & 2 deletions sample/drb/simpletuple.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down
1 change: 0 additions & 1 deletion sample/dualstack-httpd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion sample/observ.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#! /usr/local/bin/ruby

require "thread"
require "observer"

class Tick
Expand Down
1 change: 0 additions & 1 deletion sample/philos.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#
# The Dining Philosophers - thread example
#
require "thread"

srand
#srand
Expand Down
1 change: 0 additions & 1 deletion test/-ext-/postponed_job/test_postponed_job.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: false
require 'test/unit'
require 'thread'
require '-test-/postponed_job'

module Bug
Expand Down
2 changes: 0 additions & 2 deletions test/bigdecimal/test_bigdecimal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
require_relative "testbase"
require 'bigdecimal/math'

require 'thread'

class TestBigDecimal < Test::Unit::TestCase
include TestBigDecimalBase

Expand Down
3 changes: 1 addition & 2 deletions test/lib/test/unit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,7 @@ def _run_parallel suites, type, result
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
Expand Down
1 change: 0 additions & 1 deletion test/monitor/test_monitor.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: false
require "monitor"
require "thread"

require "test/unit"

Expand Down
1 change: 0 additions & 1 deletion test/ruby/lbtest.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# frozen_string_literal: false
require 'thread'

class LocalBarrier
def initialize(n)
Expand Down
1 change: 0 additions & 1 deletion test/ruby/test_autoload.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: false
require 'test/unit'
require 'tempfile'
require 'thread'

class TestAutoload < Test::Unit::TestCase
def test_autoload_so
Expand Down
1 change: 0 additions & 1 deletion test/ruby/test_backtrace.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: false
require 'test/unit'
require 'thread'
require 'tempfile'

class TestBacktrace < Test::Unit::TestCase
Expand Down
1 change: 0 additions & 1 deletion test/ruby/test_file.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: false
require 'test/unit'
require 'tempfile'
require "thread"
require "-test-/file"
require_relative 'ut_eof'

Expand Down
2 changes: 0 additions & 2 deletions test/ruby/test_thread.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: us-ascii -*-
# frozen_string_literal: false
require 'test/unit'
require 'thread'

class TestThread < Test::Unit::TestCase
class Thread < ::Thread
Expand Down Expand Up @@ -966,7 +965,6 @@ def test_thread_join_main_thread

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
Expand Down
1 change: 0 additions & 1 deletion test/ruby/test_threadgroup.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: false
require 'test/unit'
require 'thread'

class TestThreadGroup < Test::Unit::TestCase
def test_thread_init
Expand Down
1 change: 0 additions & 1 deletion test/socket/test_unix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
require "tempfile"
require "timeout"
require "tmpdir"
require "thread"
require "io/nonblock"

class TestSocket_UNIXSocket < Test::Unit::TestCase
Expand Down
1 change: 0 additions & 1 deletion test/test_mutex_m.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: false
require 'test/unit'
require 'thread'
require 'mutex_m'

class TestMutexM < Test::Unit::TestCase
Expand Down
1 change: 0 additions & 1 deletion test/test_tempfile.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: true
require 'test/unit'
require 'tempfile'
require 'thread'

class TestTempfile < Test::Unit::TestCase
def initialize(*)
Expand Down
1 change: 0 additions & 1 deletion test/test_timeout.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: false
require 'test/unit'
require 'timeout'
require 'thread'

class TestTimeout < Test::Unit::TestCase
def test_queue
Expand Down
3 changes: 0 additions & 3 deletions test/thread/test_cv.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: false
require 'test/unit'
require 'thread'
require 'tmpdir'

class TestConditionVariable < Test::Unit::TestCase
Expand Down Expand Up @@ -94,8 +93,6 @@ def test_condvar_wait_and_broadcast

def test_condvar_wait_deadlock
assert_in_out_err([], <<-INPUT, /\Afatal\nNo live threads left\. Deadlock/, [])
require "thread"
mutex = Mutex.new
cv = ConditionVariable.new
Expand Down
2 changes: 0 additions & 2 deletions test/thread/test_queue.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: false
require 'test/unit'
require 'thread'
require 'tmpdir'
require 'timeout'

Expand Down Expand Up @@ -136,7 +135,6 @@ def test_thr_kill
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
Expand Down
Loading

0 comments on commit 6064132

Please sign in to comment.