fastthread 0.5.3.5 → 0.6

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -4,7 +4,7 @@ require 'rake/testtask'
4
4
  require 'rake/gempackagetask'
5
5
  require 'tools/rakehelp'
6
6
 
7
- GEM_VERSION="0.5.3.5"
7
+ GEM_VERSION="0.6"
8
8
 
9
9
  setup_extension('fastthread', 'fastthread')
10
10
 
@@ -821,12 +821,11 @@ Init_fastthread()
821
821
 
822
822
  mutex_ivar = rb_intern("__mutex__");
823
823
 
824
- if (!RTEST(rb_require("thread"))) {
825
- rb_raise(rb_eRuntimeError, "fastthread must be required before thread");
826
- }
824
+ rb_require("thread");
827
825
 
828
826
  private_eThreadError = rb_const_get(rb_cObject, rb_intern("ThreadError"));
829
827
 
828
+ rb_mod_remove_const(rb_cObject, rb_str_new2("Mutex"));
830
829
  rb_cMutex = rb_define_class("Mutex", rb_cObject);
831
830
  rb_define_alloc_func(rb_cMutex, rb_mutex_alloc);
832
831
  rb_define_method(rb_cMutex, "marshal_load", dummy_load, 1);
@@ -839,6 +838,7 @@ Init_fastthread()
839
838
  rb_define_method(rb_cMutex, "exclusive_unlock", rb_mutex_exclusive_unlock, 0);
840
839
  rb_define_method(rb_cMutex, "synchronize", rb_mutex_synchronize, 0);
841
840
 
841
+ rb_mod_remove_const(rb_cObject, rb_str_new2("ConditionVariable"));
842
842
  rb_cConditionVariable = rb_define_class("ConditionVariable", rb_cObject);
843
843
  rb_define_alloc_func(rb_cConditionVariable, rb_condvar_alloc);
844
844
  rb_define_method(rb_cConditionVariable, "marshal_load", dummy_load, 1);
@@ -848,6 +848,7 @@ Init_fastthread()
848
848
  rb_define_method(rb_cConditionVariable, "broadcast", rb_condvar_broadcast, 0);
849
849
  rb_define_method(rb_cConditionVariable, "signal", rb_condvar_signal, 0);
850
850
 
851
+ rb_mod_remove_const(rb_cObject, rb_str_new2("Queue"));
851
852
  rb_cQueue = rb_define_class("Queue", rb_cObject);
852
853
  rb_define_alloc_func(rb_cQueue, rb_queue_alloc);
853
854
  rb_define_method(rb_cQueue, "marshal_load", rb_queue_marshal_load, 1);
@@ -864,6 +865,7 @@ Init_fastthread()
864
865
  rb_alias(rb_cQueue, rb_intern("shift"), rb_intern("pop"));
865
866
  rb_alias(rb_cQueue, rb_intern("size"), rb_intern("length"));
866
867
 
868
+ rb_mod_remove_const(rb_cObject, rb_str_new2("SizedQueue"));
867
869
  rb_cSizedQueue = rb_define_class("SizedQueue", rb_cQueue);
868
870
  rb_define_method(rb_cSizedQueue, "initialize", rb_sized_queue_max_set, 1);
869
871
  rb_define_method(rb_cSizedQueue, "clear", rb_queue_clear, 0);
@@ -1,6 +1,10 @@
1
1
  require 'test/unit'
2
- $:.unshift File.expand_path( File.join( File.dirname( __FILE__ ), "../ext/fastthread" ) )
3
- require 'fastthread'
2
+ if RUBY_PLATFORM == "java"
3
+ require 'thread'
4
+ else
5
+ $:.unshift File.expand_path( File.join( File.dirname( __FILE__ ), "../ext/fastthread" ) )
6
+ require 'fastthread'
7
+ end
4
8
 
5
9
  class TestCondVar < Test::Unit::TestCase
6
10
  def test_signal
@@ -1,6 +1,10 @@
1
1
  require 'test/unit'
2
- $:.unshift File.expand_path( File.join( File.dirname( __FILE__ ), "../ext/fastthread" ) )
3
- require 'fastthread'
2
+ if RUBY_PLATFORM == "java"
3
+ require 'thread'
4
+ else
5
+ $:.unshift File.expand_path( File.join( File.dirname( __FILE__ ), "../ext/fastthread" ) )
6
+ require 'fastthread'
7
+ end
4
8
 
5
9
  class TestMutex < Test::Unit::TestCase
6
10
  def self.mutex_test( name, &body )
@@ -1,6 +1,10 @@
1
1
  require 'test/unit'
2
- $:.unshift File.expand_path( File.join( File.dirname( __FILE__ ), "../ext/fastthread" ) )
3
- require 'fastthread'
2
+ if RUBY_PLATFORM == "java"
3
+ require 'thread'
4
+ else
5
+ $:.unshift File.expand_path( File.join( File.dirname( __FILE__ ), "../ext/fastthread" ) )
6
+ require 'fastthread'
7
+ end
4
8
 
5
9
  class TestQueue < Test::Unit::TestCase
6
10
  def check_sequence( q )
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: fastthread
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.5.3.5
7
- date: 2006-12-30 00:00:00 -05:00
6
+ version: "0.6"
7
+ date: 2006-12-31 00:00:00 -05:00
8
8
  summary: Optimized replacement for thread.rb primitives
9
9
  require_paths:
10
10
  - lib