Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

em.thread

Class EM_CONDITION_VAR


Direct ancestors

SDL_MUTEX_FUNCTIONS_EXTERNAL

Creation

Features

Invariants

indexing

description

*** Since Eiffel doesn't correctly support threats, this doesn't work yet ***

A condition variable that can be used to let threads wait for each
other.

date

$Date: 2005/10/26 12:19:15 $

revision

$Revision: 1.4 $

class

EM_CONDITION_VAR

create

make

-- Creates a new condition variable.

feature -- Commands

broadcast

-- Restarts all threads that are waiting on the condition variable.

signal

-- Restarts one of the threads that are waiting on the condition variable.

wait (a_mutex : EM_MUTEX)

-- Wait on the condition variable and unlocks a_mutex.
-- The mutex must be locked before calling this feature.
-- The mutex is needed to prevent raceconditions between
-- a wait and a signal operation.

require
mutex_not_void: a_mutex /= Void
wait_with_timeout (a_mutex : EM_MUTEX; a_timeout : INTEGER) : BOOLEAN

-- Wait on the condition variable for at most a_timeout milliseconds.
-- Returns True if the condition variable was signaled.
-- Returns False if a timeout or an error occured.

require
mutex_not_void: a_mutex /= Void

invariant


-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end