Class: Synapse::ProcessManager::LockManager

Inherits:
Object
  • Object
show all
Defined in:
lib/synapse/process_manager/lock_manager.rb

Overview

Represents a mechanism for synchronizing access to processes

This base implementation does no locking; it can be used if processes are thread safe and don’t need any additional synchronization.

Instance Method Summary collapse

Instance Method Details

#obtain_lock(process_id) ⇒ undefined

Obtains a lock for a process with the given identifier, blocking if necessary

Parameters:

  • process_id (String)

Returns:

  • (undefined)


12
# File 'lib/synapse/process_manager/lock_manager.rb', line 12

def obtain_lock(process_id); end

#release_lock(process_id) ⇒ undefined

Releases the lock for a process with the given identifier

Parameters:

  • process_id (String)

Returns:

  • (undefined)

Raises:

  • (ThreadError)

    If thread didn’t previously hold the lock



19
# File 'lib/synapse/process_manager/lock_manager.rb', line 19

def release_lock(process_id); end