Class: Gtk3assist::Threadding
- Inherits:
-
Object
- Object
- Gtk3assist::Threadding
- Defined in:
- lib/gtk3assist_threadding.rb
Class Method Summary collapse
-
.enable_threadding(args = nil) ⇒ Object
Enables other threads to be run and interrupts to be used (<CTRL> + <C>).
-
.enable_threadding_if_necessary(args = nil) ⇒ Object
Only enables the threadding if it is necessary (its not necessary on JRuby).
Class Method Details
.enable_threadding(args = nil) ⇒ Object
Enables other threads to be run and interrupts to be used (<CTRL> + <C>).
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/gtk3assist_threadding.rb', line 3 def self.enable_threadding(args = nil) #Never start this more than once. return nil if @enable_threadding @enable_threadding = true #Amount of time to check if a new thread wants to run. if args and args[:sleep] @time = args[:sleep] else @time = 100 end @method = self.method(:enable_threadding_pass) #Call the method (which then calls itself based on timings). enable_threadding_pass end |
.enable_threadding_if_necessary(args = nil) ⇒ Object
Only enables the threadding if it is necessary (its not necessary on JRuby).
22 23 24 25 26 27 28 29 30 |
# File 'lib/gtk3assist_threadding.rb', line 22 def self.enable_threadding_if_necessary(args = nil) if RUBY_ENGINE != "jruby" enable = true else enable = false end Gtk3assist::Threadding.enable_threadding(args) if enable end |