1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Remove unnecessary require 'thread'

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kazu 2017-10-08 07:00:01 +00:00
parent 838a91633c
commit 6064132c42
47 changed files with 2 additions and 65 deletions

View file

@ -47,7 +47,6 @@
# Translation of presentation on Ruby by Masatoshi Seki. # Translation of presentation on Ruby by Masatoshi Seki.
require 'socket' require 'socket'
require 'thread'
require 'io/wait' require 'io/wait'
require 'drb/eq' require 'drb/eq'

View file

@ -5,7 +5,6 @@
=end =end
require 'drb/drb' require 'drb/drb'
require 'thread'
require 'monitor' require 'monitor'
module DRb module DRb

View file

@ -10,7 +10,6 @@
# #
# #
IRB.fail CantShiftToMultiIrbMode unless defined?(Thread) IRB.fail CantShiftToMultiIrbMode unless defined?(Thread)
require "thread"
module IRB module IRB
class JobManager class JobManager

View file

@ -39,8 +39,6 @@ EOF
when 2 # binding in loaded file(thread use) when 2 # binding in loaded file(thread use)
unless defined? BINDING_QUEUE unless defined? BINDING_QUEUE
require "thread"
IRB.const_set(:BINDING_QUEUE, Thread::SizedQueue.new(1)) IRB.const_set(:BINDING_QUEUE, Thread::SizedQueue.new(1))
Thread.abort_on_exception = true Thread.abort_on_exception = true
Thread.start do Thread.start do

View file

@ -7,8 +7,6 @@
# You can freely distribute/modify this library. # You can freely distribute/modify this library.
# #
require 'thread'
# #
# In concurrent programming, a monitor is an object or module intended to be # 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 # used safely by more than one thread. The defining characteristic of a

View file

@ -10,9 +10,6 @@
# #
# -- # --
require 'thread'
# = mutex_m.rb # = mutex_m.rb
# #
# When 'mutex_m' is required, any object that extends or includes Mutex_m will # When 'mutex_m' is required, any object that extends or includes Mutex_m will

View file

@ -1,6 +1,5 @@
# frozen_string_literal: false # frozen_string_literal: false
require 'drb/drb' require 'drb/drb'
require 'thread'
## ##
# A module to implement the Linda distributed computing paradigm in Ruby. # A module to implement the Linda distributed computing paradigm in Ruby.

View file

@ -4,7 +4,6 @@
# #
require 'drb/drb' require 'drb/drb'
require 'rinda/rinda' require 'rinda/rinda'
require 'thread'
require 'ipaddr' require 'ipaddr'
module Rinda module Rinda

View file

@ -1,6 +1,5 @@
# frozen_string_literal: false # frozen_string_literal: false
require 'monitor' require 'monitor'
require 'thread'
require 'drb/drb' require 'drb/drb'
require 'rinda/rinda' require 'rinda/rinda'
require 'forwardable' require 'forwardable'

View file

@ -11,7 +11,6 @@
# #
require "e2mmap" require "e2mmap"
require "thread"
require "shell/error" require "shell/error"
require "shell/filter" require "shell/filter"

View file

@ -10,8 +10,6 @@
# #
# #
require "forwardable" require "forwardable"
require "thread"
require "sync" require "sync"
class Shell class Shell

View file

@ -1,5 +1,4 @@
# frozen_string_literal: false # frozen_string_literal: false
require 'thread'
# The Singleton module implements the Singleton pattern. # The Singleton module implements the Singleton pattern.
# #

View file

@ -5,7 +5,6 @@
# $Revision: 1.3 $ # $Revision: 1.3 $
# by Keiju ISHITSUKA(Nihon Rational Software Co.,Ltd.) # by Keiju ISHITSUKA(Nihon Rational Software Co.,Ltd.)
require "thread.rb"
require "e2mmap.rb" require "e2mmap.rb"
# #

View file

@ -2,7 +2,6 @@
#-- #--
# $Release Version: 0.3$ # $Release Version: 0.3$
# $Revision: 1.12 $ # $Revision: 1.12 $
require "thread"
## ##
# Outputs a source level execution trace of a Ruby program. # Outputs a source level execution trace of a Ruby program.

View file

@ -9,8 +9,6 @@
# #
# $IPR: abstract.rb,v 1.24 2003/07/11 11:16:46 gotoyuzo Exp $ # $IPR: abstract.rb,v 1.24 2003/07/11 11:16:46 gotoyuzo Exp $
require 'thread'
require 'webrick/htmlutils' require 'webrick/htmlutils'
require 'webrick/httputils' require 'webrick/httputils'
require 'webrick/httpstatus' require 'webrick/httpstatus'

View file

@ -9,7 +9,6 @@
# #
# $IPR: filehandler.rb,v 1.44 2003/06/07 01:34:51 gotoyuzo Exp $ # $IPR: filehandler.rb,v 1.44 2003/06/07 01:34:51 gotoyuzo Exp $
require 'thread'
require 'time' require 'time'
require 'webrick/htmlutils' require 'webrick/htmlutils'

View file

@ -9,7 +9,6 @@
# #
# $IPR: server.rb,v 1.62 2003/07/22 19:20:43 gotoyuzo Exp $ # $IPR: server.rb,v 1.62 2003/07/22 19:20:43 gotoyuzo Exp $
require 'thread'
require 'socket' require 'socket'
require 'webrick/config' require 'webrick/config'
require 'webrick/log' require 'webrick/log'

View file

@ -91,7 +91,6 @@ module WEBrick
########### ###########
require "thread"
require "timeout" require "timeout"
require "singleton" require "singleton"

View file

@ -2,7 +2,6 @@
distributed Ruby --- chat server distributed Ruby --- chat server
Copyright (c) 1999-2000 Masatoshi SEKI Copyright (c) 1999-2000 Masatoshi SEKI
=end =end
require 'thread'
require 'drb/drb' require 'drb/drb'
class ChatEntry class ChatEntry

View file

@ -17,7 +17,6 @@
require 'drb/drb' require 'drb/drb'
require 'chasen' require 'chasen'
require 'thread'
class Dhasen class Dhasen
include DRbUndumped include DRbUndumped

View file

@ -4,7 +4,6 @@
=end =end
require 'drb/drb' require 'drb/drb'
require 'thread'
class Logger class Logger
def initialize(fname) def initialize(fname)

View file

@ -3,7 +3,6 @@
Copyright (c) 1999-2000 Masatoshi SEKI Copyright (c) 1999-2000 Masatoshi SEKI
=end =end
require 'thread'
require 'drb/drb' require 'drb/drb'
DRb.start_service(nil, Thread::Queue.new) DRb.start_service(nil, Thread::Queue.new)

View file

@ -1,7 +1,6 @@
require 'webrick' require 'webrick'
require 'drb/drb' require 'drb/drb'
require 'drb/http0' require 'drb/http0'
require 'thread'
module DRb module DRb
module HTTP0 module HTTP0

View file

@ -35,7 +35,6 @@ How to play.
| 2 | 2
=end =end
require 'thread.rb'
require 'drb/drb' require 'drb/drb'
module DRbNamedObject module DRbNamedObject

View file

@ -3,8 +3,6 @@
# Copyright (c) 1999-2000 Masatoshi SEKI # Copyright (c) 1999-2000 Masatoshi SEKI
# You can redistribute it and/or modify it under the same terms as Ruby. # You can redistribute it and/or modify it under the same terms as Ruby.
require 'thread'
class TupleSpace class TupleSpace
class Template class Template
def initialize(list) def initialize(list)

View file

@ -1,7 +1,6 @@
require 'drb/drb' require 'drb/drb'
require 'drb/eq' require 'drb/eq'
require 'rinda/ring' require 'rinda/ring'
require 'thread'
class RingEcho class RingEcho
include DRbUndumped include DRbUndumped

View file

@ -3,8 +3,6 @@
# Copyright (c) 1999-2000 Masatoshi SEKI # Copyright (c) 1999-2000 Masatoshi SEKI
# You can redistribute it and/or modify it under the same terms as Ruby. # You can redistribute it and/or modify it under the same terms as Ruby.
require 'thread'
class SimpleTupleSpace class SimpleTupleSpace
def initialize def initialize
@hash = {} @hash = {}

View file

@ -3,7 +3,6 @@
# The code demonstrates how a multi-protocol daemon should be written. # The code demonstrates how a multi-protocol daemon should be written.
require "socket" require "socket"
require "thread"
port = 8888 port = 8888
res = Socket.getaddrinfo(nil, port, nil, Socket::SOCK_STREAM, nil, Socket::AI_PASSIVE) res = Socket.getaddrinfo(nil, port, nil, Socket::SOCK_STREAM, nil, Socket::AI_PASSIVE)

View file

@ -1,6 +1,5 @@
#! /usr/local/bin/ruby #! /usr/local/bin/ruby
require "thread"
require "observer" require "observer"
class Tick class Tick

View file

@ -1,7 +1,6 @@
# #
# The Dining Philosophers - thread example # The Dining Philosophers - thread example
# #
require "thread"
srand srand
#srand #srand

View file

@ -1,6 +1,5 @@
# frozen_string_literal: false # frozen_string_literal: false
require 'test/unit' require 'test/unit'
require 'thread'
require '-test-/postponed_job' require '-test-/postponed_job'
module Bug module Bug

View file

@ -2,8 +2,6 @@
require_relative "testbase" require_relative "testbase"
require 'bigdecimal/math' require 'bigdecimal/math'
require 'thread'
class TestBigDecimal < Test::Unit::TestCase class TestBigDecimal < Test::Unit::TestCase
include TestBigDecimalBase include TestBigDecimalBase

View file

@ -452,8 +452,7 @@ module Test
return return
end end
# Require needed things for parallel running # Require needed thing for parallel running
require 'thread'
require 'timeout' require 'timeout'
@tasks = @files.dup # Array of filenames. @tasks = @files.dup # Array of filenames.
@need_quit = false @need_quit = false

View file

@ -1,6 +1,5 @@
# frozen_string_literal: false # frozen_string_literal: false
require "monitor" require "monitor"
require "thread"
require "test/unit" require "test/unit"

View file

@ -1,5 +1,4 @@
# frozen_string_literal: false # frozen_string_literal: false
require 'thread'
class LocalBarrier class LocalBarrier
def initialize(n) def initialize(n)

View file

@ -1,7 +1,6 @@
# frozen_string_literal: false # frozen_string_literal: false
require 'test/unit' require 'test/unit'
require 'tempfile' require 'tempfile'
require 'thread'
class TestAutoload < Test::Unit::TestCase class TestAutoload < Test::Unit::TestCase
def test_autoload_so def test_autoload_so

View file

@ -1,6 +1,5 @@
# frozen_string_literal: false # frozen_string_literal: false
require 'test/unit' require 'test/unit'
require 'thread'
require 'tempfile' require 'tempfile'
class TestBacktrace < Test::Unit::TestCase class TestBacktrace < Test::Unit::TestCase

View file

@ -1,7 +1,6 @@
# frozen_string_literal: false # frozen_string_literal: false
require 'test/unit' require 'test/unit'
require 'tempfile' require 'tempfile'
require "thread"
require "-test-/file" require "-test-/file"
require_relative 'ut_eof' require_relative 'ut_eof'

View file

@ -1,7 +1,6 @@
# -*- coding: us-ascii -*- # -*- coding: us-ascii -*-
# frozen_string_literal: false # frozen_string_literal: false
require 'test/unit' require 'test/unit'
require 'thread'
class TestThread < Test::Unit::TestCase class TestThread < Test::Unit::TestCase
class Thread < ::Thread class Thread < ::Thread
@ -966,7 +965,6 @@ _eom
def test_main_thread_status_at_exit def test_main_thread_status_at_exit
assert_in_out_err([], <<-'INPUT', ["false false aborting"], []) assert_in_out_err([], <<-'INPUT', ["false false aborting"], [])
require 'thread'
q = Thread::Queue.new q = Thread::Queue.new
Thread.new(Thread.current) {|mth| Thread.new(Thread.current) {|mth|
begin begin

View file

@ -1,6 +1,5 @@
# frozen_string_literal: false # frozen_string_literal: false
require 'test/unit' require 'test/unit'
require 'thread'
class TestThreadGroup < Test::Unit::TestCase class TestThreadGroup < Test::Unit::TestCase
def test_thread_init def test_thread_init

View file

@ -9,7 +9,6 @@ require "test/unit"
require "tempfile" require "tempfile"
require "timeout" require "timeout"
require "tmpdir" require "tmpdir"
require "thread"
require "io/nonblock" require "io/nonblock"
class TestSocket_UNIXSocket < Test::Unit::TestCase class TestSocket_UNIXSocket < Test::Unit::TestCase

View file

@ -1,6 +1,5 @@
# frozen_string_literal: false # frozen_string_literal: false
require 'test/unit' require 'test/unit'
require 'thread'
require 'mutex_m' require 'mutex_m'
class TestMutexM < Test::Unit::TestCase class TestMutexM < Test::Unit::TestCase

View file

@ -1,7 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'test/unit' require 'test/unit'
require 'tempfile' require 'tempfile'
require 'thread'
class TestTempfile < Test::Unit::TestCase class TestTempfile < Test::Unit::TestCase
def initialize(*) def initialize(*)

View file

@ -1,7 +1,6 @@
# frozen_string_literal: false # frozen_string_literal: false
require 'test/unit' require 'test/unit'
require 'timeout' require 'timeout'
require 'thread'
class TestTimeout < Test::Unit::TestCase class TestTimeout < Test::Unit::TestCase
def test_queue def test_queue

View file

@ -1,6 +1,5 @@
# frozen_string_literal: false # frozen_string_literal: false
require 'test/unit' require 'test/unit'
require 'thread'
require 'tmpdir' require 'tmpdir'
class TestConditionVariable < Test::Unit::TestCase class TestConditionVariable < Test::Unit::TestCase
@ -94,8 +93,6 @@ class TestConditionVariable < Test::Unit::TestCase
def test_condvar_wait_deadlock def test_condvar_wait_deadlock
assert_in_out_err([], <<-INPUT, /\Afatal\nNo live threads left\. Deadlock/, []) assert_in_out_err([], <<-INPUT, /\Afatal\nNo live threads left\. Deadlock/, [])
require "thread"
mutex = Mutex.new mutex = Mutex.new
cv = ConditionVariable.new cv = ConditionVariable.new

View file

@ -1,6 +1,5 @@
# frozen_string_literal: false # frozen_string_literal: false
require 'test/unit' require 'test/unit'
require 'thread'
require 'tmpdir' require 'tmpdir'
require 'timeout' require 'timeout'
@ -136,7 +135,6 @@ class TestQueue < Test::Unit::TestCase
total_count = 250 total_count = 250
begin begin
assert_normal_exit(<<-"_eom", bug5343, {:timeout => timeout, :chdir=>d}) assert_normal_exit(<<-"_eom", bug5343, {:timeout => timeout, :chdir=>d})
require "thread"
#{total_count}.times do |i| #{total_count}.times do |i|
open("test_thr_kill_count", "w") {|f| f.puts i } open("test_thr_kill_count", "w") {|f| f.puts i }
queue = Queue.new queue = Queue.new

View file

@ -65,7 +65,6 @@ static const char* rb_mutex_unlock_th(rb_mutex_t *mutex, rb_thread_t volatile *t
* *
* Example: * Example:
* *
* require 'thread'
* semaphore = Mutex.new * semaphore = Mutex.new
* *
* a = Thread.new { * a = Thread.new {
@ -673,8 +672,7 @@ queue_closed_result(VALUE self, struct rb_queue *q)
* *
* Example: * Example:
* *
* require 'thread' * queue = Queue.new
* queue = Queue.new
* *
* producer = Thread.new do * producer = Thread.new do
* 5.times do |i| * 5.times do |i|
@ -1211,8 +1209,6 @@ struct rb_condvar {
* *
* Example: * Example:
* *
* require 'thread'
*
* mutex = Mutex.new * mutex = Mutex.new
* resource = ConditionVariable.new * resource = ConditionVariable.new
* *