# Class: Concurrent::Synchronization::Condition

Inherits:
  LockableObject
  - Object
  - LockableObject
  - Concurrent::Synchronization::Condition
  show all

Defined in:
  lib/concurrent/synchronization/condition.rb

## Overview

TODO (pitr-ch 04-Dec-2016): should be in edge

## Instance Method Summary collapse

- #broadcast ⇒ undocumented
- #initialize(lock) ⇒ Condition constructor

  A new instance of Condition.

- #ns_broadcast ⇒ undocumented
- #ns_signal ⇒ undocumented
- #ns_wait(timeout = nil) ⇒ undocumented
- #ns_wait_until(timeout = nil, &condition) ⇒ undocumented
- #signal ⇒ undocumented
- #wait(timeout = nil) ⇒ undocumented
- #wait_until(timeout = nil, &condition) ⇒ undocumented

## Constructor Details

### #initialize(lock) ⇒ `Condition`

Returns a new instance of Condition

    14
    15
    16
    17

    # File 'lib/concurrent/synchronization/condition.rb', line 14

    def initialize(lock)
      super()
      @Lock = lock
    end

## Instance Method Details

### #broadcast ⇒ `undocumented`

    43
    44
    45

    # File 'lib/concurrent/synchronization/condition.rb', line 43

    def broadcast
      @Lock.synchronize { ns_broadcast }
    end

### #ns_broadcast ⇒ `undocumented`

    47
    48
    49

    # File 'lib/concurrent/synchronization/condition.rb', line 47

    def ns_broadcast
      synchronize { super }
    end

### #ns_signal ⇒ `undocumented`

    39
    40
    41

    # File 'lib/concurrent/synchronization/condition.rb', line 39

    def ns_signal
      synchronize { super }
    end

### #ns_wait(timeout = nil) ⇒ `undocumented`

    23
    24
    25

    # File 'lib/concurrent/synchronization/condition.rb', line 23

    def ns_wait(timeout = nil)
      synchronize { super(timeout) }
    end

### #ns_wait_until(timeout = nil, &condition) ⇒ `undocumented`

    31
    32
    33

    # File 'lib/concurrent/synchronization/condition.rb', line 31

    def ns_wait_until(timeout = nil, &condition)
      synchronize { super(timeout, &condition) }
    end

### #signal ⇒ `undocumented`

    35
    36
    37

    # File 'lib/concurrent/synchronization/condition.rb', line 35

    def signal
      @Lock.synchronize { ns_signal }
    end

### #wait(timeout = nil) ⇒ `undocumented`

    19
    20
    21

    # File 'lib/concurrent/synchronization/condition.rb', line 19

    def wait(timeout = nil)
      @Lock.synchronize { ns_wait(timeout) }
    end

### #wait_until(timeout = nil, &condition) ⇒ `undocumented`

    27
    28
    29

    # File 'lib/concurrent/synchronization/condition.rb', line 27

    def wait_until(timeout = nil, &condition)
      @Lock.synchronize { ns_wait_until(timeout, &condition) }
    end