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

em.thread

Class EM_PROCEDURE_THREAD


Direct ancestors

EM_THREAD

Creation

Features

Invariants

indexing

description

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

date

$Date: 2005/10/26 14:50:40 $

revision

$Revision: 1.6 $

class

EM_PROCEDURE_THREAD

inherit

EM_THREAD

create

make_from_procedure (a_proc: PROCEDURE[ANY, TUPLE])

-- Make from procedure.

feature -- Access

audio_subsystem: EM_AUDIO_SUBSYSTEM

-- EiffelMedia audio subsystem

-- (From EM_SHARED_SUBSYSTEMS)

ensure
audio_subsystem_not_void: Result /= Void
cdrom_subsystem: EM_CDROM_SUBSYSTEM

-- EiffelMedia CD ROM subsystem

-- (From EM_SHARED_SUBSYSTEMS)

ensure
cdrom_subsystem_not_void: Result /= Void
joystick_subsystem: EM_JOYSTICK_SUBSYSTEM

-- EiffelMedia joystick subsystem

-- (From EM_SHARED_SUBSYSTEMS)

ensure
joystick_subsystem_not_void: Result /= Void
network_subsystem: EM_NETWORK_SUBSYSTEM

-- EiffelMedia network subsystem is

-- (From EM_SHARED_SUBSYSTEMS)

ensure
network_subsystem_not_void: Result /= void
timer_subsystem: EM_TIMER_SUBSYSTEM

-- EiffelMedia timer subsystem

-- (From EM_SHARED_SUBSYSTEMS)

ensure
timer_subsystem_not_void: Result /= Void
video_subsystem: EM_VIDEO_SUBSYSTEM

-- EiffelMedia video subsystem

-- (From EM_SHARED_SUBSYSTEMS)

ensure
video_subsystem_not_void: Result /= Void

feature -- inherited features

make_from_procedure (a_proc: PROCEDURE[ANY, TUPLE])

-- Make from procedure.

procedure: PROCEDURE[ANY, TUPLE]

-- procedure to run

run: INTEGER

-- call the agent

-- (From EM_THREAD)

feature -- Control

kill

-- Aborts the thread gracelessly.
-- You should avoid using this.

-- (From EM_THREAD)

require
running: is_running
ensure
not_running: not is_running
start

-- Starts the thread.

-- (From EM_THREAD)

require
not_running: not is_running
wait

-- Wait for a thread to finish (no timeouts are supported -> worst case: wait forever, deadlock)
-- This should only be called by an other thread than this one

-- (From EM_THREAD)

require
running: is_running

feature -- Status information

id: INTEGER

-- Returns the ID of this thread.

-- (From EM_THREAD)

require
thread_running: is_running
is_finished: BOOLEAN

-- Return True if the thread has finished its execution.

-- (From EM_THREAD)

is_running: BOOLEAN

-- Returns True if the thread is running.

-- (From EM_THREAD)

return_code: INTEGER

-- The return code of the function that was executed.
-- This will be -1 if is_finished is False.

-- (From EM_THREAD)

invariant

-- From EM_THREAD

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

end