Linux lorencats.com 5.10.103-v7l+ #1529 SMP Tue Mar 8 12:24:00 GMT 2022 armv7l
Apache/2.4.59 (Raspbian)
: 10.0.0.29 | : 216.73.216.130
Cant Read [ /etc/named.conf ]
7.3.31-1~deb10u7
root
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
usr /
lib /
ruby /
vendor_ruby /
concurrent /
atomic /
[ HOME SHELL ]
Name
Size
Permission
Action
abstract_thread_local_var.rb
1.3
KB
-rw-r--r--
atomic_boolean.rb
3.8
KB
-rw-r--r--
atomic_fixnum.rb
4.51
KB
-rw-r--r--
atomic_reference.rb
1.27
KB
-rw-r--r--
count_down_latch.rb
3.24
KB
-rw-r--r--
cyclic_barrier.rb
3.99
KB
-rw-r--r--
event.rb
2.76
KB
-rw-r--r--
java_count_down_latch.rb
964
B
-rw-r--r--
java_thread_local_var.rb
691
B
-rw-r--r--
mutex_atomic_boolean.rb
1.23
KB
-rw-r--r--
mutex_atomic_fixnum.rb
1.55
KB
-rw-r--r--
mutex_count_down_latch.rb
970
B
-rw-r--r--
mutex_semaphore.rb
2.7
KB
-rw-r--r--
read_write_lock.rb
8.22
KB
-rw-r--r--
reentrant_read_write_lock.rb
13.87
KB
-rw-r--r--
ruby_thread_local_var.rb
4.85
KB
-rw-r--r--
semaphore.rb
4.15
KB
-rw-r--r--
thread_local_var.rb
3.01
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : cyclic_barrier.rb
require 'concurrent/synchronization' require 'concurrent/utility/native_integer' module Concurrent # A synchronization aid that allows a set of threads to all wait for each # other to reach a common barrier point. # @example # barrier = Concurrent::CyclicBarrier.new(3) # jobs = Array.new(3) { |i| -> { sleep i; p done: i } } # process = -> (i) do # # waiting to start at the same time # barrier.wait # # execute job # jobs[i].call # # wait for others to finish # barrier.wait # end # threads = 2.times.map do |i| # Thread.new(i, &process) # end # # # use main as well # process.call 2 # # # here we can be sure that all jobs are processed class CyclicBarrier < Synchronization::LockableObject # @!visibility private Generation = Struct.new(:status) private_constant :Generation # Create a new `CyclicBarrier` that waits for `parties` threads # # @param [Fixnum] parties the number of parties # @yield an optional block that will be executed that will be executed after # the last thread arrives and before the others are released # # @raise [ArgumentError] if `parties` is not an integer or is less than zero def initialize(parties, &block) Utility::NativeInteger.ensure_integer_and_bounds parties Utility::NativeInteger.ensure_positive_and_no_zero parties super(&nil) synchronize { ns_initialize parties, &block } end # @return [Fixnum] the number of threads needed to pass the barrier def parties synchronize { @parties } end # @return [Fixnum] the number of threads currently waiting on the barrier def number_waiting synchronize { @number_waiting } end # Blocks on the barrier until the number of waiting threads is equal to # `parties` or until `timeout` is reached or `reset` is called # If a block has been passed to the constructor, it will be executed once by # the last arrived thread before releasing the others # @param [Fixnum] timeout the number of seconds to wait for the counter or # `nil` to block indefinitely # @return [Boolean] `true` if the `count` reaches zero else false on # `timeout` or on `reset` or if the barrier is broken def wait(timeout = nil) synchronize do return false unless @generation.status == :waiting @number_waiting += 1 if @number_waiting == @parties @action.call if @action ns_generation_done @generation, :fulfilled true else generation = @generation if ns_wait_until(timeout) { generation.status != :waiting } generation.status == :fulfilled else ns_generation_done generation, :broken, false false end end end end # resets the barrier to its initial state # If there is at least one waiting thread, it will be woken up, the `wait` # method will return false and the barrier will be broken # If the barrier is broken, this method restores it to the original state # # @return [nil] def reset synchronize { ns_generation_done @generation, :reset } end # A barrier can be broken when: # - a thread called the `reset` method while at least one other thread was waiting # - at least one thread timed out on `wait` method # # A broken barrier can be restored using `reset` it's safer to create a new one # @return [Boolean] true if the barrier is broken otherwise false def broken? synchronize { @generation.status != :waiting } end protected def ns_generation_done(generation, status, continue = true) generation.status = status ns_next_generation if continue ns_broadcast end def ns_next_generation @generation = Generation.new(:waiting) @number_waiting = 0 end def ns_initialize(parties, &block) @parties = parties @action = block ns_next_generation end end end
Close