Linux iad1-shared-b7-18 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
Apache
: 67.205.6.31 | : 216.73.216.47
Cant Read [ /etc/named.conf ]
8.2.29
fernandoquevedo
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
lib /
ruby /
vendor_ruby /
moneta /
[ HOME SHELL ]
Name
Size
Permission
Action
adapters
[ DIR ]
drwxr-xr-x
transformer
[ DIR ]
drwxr-xr-x
builder.rb
2.47
KB
-rw-r--r--
cache.rb
2.77
KB
-rw-r--r--
expires.rb
2.29
KB
-rw-r--r--
lock.rb
467
B
-rw-r--r--
logger.rb
1.83
KB
-rw-r--r--
mixins.rb
9.72
KB
-rw-r--r--
optionmerger.rb
1.3
KB
-rw-r--r--
pool.rb
1.36
KB
-rw-r--r--
proxy.rb
2.71
KB
-rw-r--r--
server.rb
3.3
KB
-rw-r--r--
shared.rb
1.64
KB
-rw-r--r--
stack.rb
2.36
KB
-rw-r--r--
synchronize.rb
3.07
KB
-rw-r--r--
transformer.rb
7.58
KB
-rw-r--r--
utils.rb
584
B
-rw-r--r--
version.rb
80
B
-rw-r--r--
weak.rb
949
B
-rw-r--r--
wrapper.rb
1.05
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : synchronize.rb
module Moneta # Base class for {Mutex} and {Semaphore} # @api private class SynchronizePrimitive # Synchronize block # # @api public # @yieldparam Synchronized block # @return [Object] result of block def synchronize enter yield ensure leave end # Try to enter critical section (nonblocking) # # @api public # @return [Boolean] true if the lock was acquired def try_enter raise 'Already locked' if @locked enter_primitive ? @locked = true : false end alias_method :try_lock, :try_enter # Enter critical section (blocking) # # @api public # @param [Number] timeout Maximum time to wait # @param [Number] wait Sleep time between tries to acquire lock # @return [Boolean] true if the lock was aquired def enter(timeout = nil, wait = 0.01) time_at_timeout = Time.now + timeout if timeout while !timeout || Time.now < time_at_timeout return true if try_enter sleep(wait) end false end alias_method :lock, :enter # Leave critical section # # @api public def leave raise 'Not locked' unless @locked leave_primitive @locked = false nil end alias_method :unlock, :leave # Is the lock acquired? # # @api public def locked? @locked end end # Distributed/shared store-wide mutex # # @example Use `Moneta::Mutex` # mutex = Moneta::Mutex.new(store, 'mutex') # mutex.synchronize do # # Synchronized access # store['counter'] += 1 # end # # @api public class Mutex < SynchronizePrimitive # @param [Moneta store] store The store we want to lock # @param [Object] lock Key of the lock entry def initialize(store, lock) raise 'Store must support feature :create' unless store.supports?(:create) @store, @lock = store, lock end protected def enter_primitive @store.create(@lock, '', expires: false) end def leave_primitive @store.delete(@lock) end end # Distributed/shared store-wide semaphore # # @example Use `Moneta::Semaphore` # semaphore = Moneta::Semaphore.new(store, 'semaphore', 2) # semaphore.synchronize do # # Synchronized access # # ... # end # # @api public class Semaphore < SynchronizePrimitive # @param [Moneta store] store The store we want to lock # @param [Object] counter Key of the counter entry # @param [Fixnum] max Maximum number of threads which are allowed to enter the critical section def initialize(store, counter, max = 1) raise 'Store must support feature :increment' unless store.supports?(:increment) @store, @counter, @max = store, counter, max @store.increment(@counter, 0, expires: false) # Ensure that counter exists end protected def enter_primitive if @store.increment(@counter, 1) <= @max true else @store.decrement(@counter) false end end def leave_primitive @store.decrement(@counter) end end end
Close