Class: Concurrent::Synchronization::Condition — Concurrent

Class List Method List File List

# 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)

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

  A new instance of Condition.

- - (undocumented) 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)

## Constructor Details

### - (`Condition`) initialize(lock)

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

### - (`undocumented`) broadcast

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

    def broadcast
      @Lock.synchronize { ns_broadcast }
    end

### - (`undocumented`) ns_broadcast

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

    def ns_broadcast
      synchronize { super }
    end

### - (`undocumented`) ns_signal

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

    def ns_signal
      synchronize { super }
    end

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

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

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

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

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

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

### - (`undocumented`) signal

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

    def signal
      @Lock.synchronize { ns_signal }
    end

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

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

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

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

    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