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

em.thread

Class EM_THREAD_CALLBACK


Direct ancestors

INT_VOIDP_ANONYMOUS_CALLBACK_CALLBACK, EM_THREAD_SUBSYSTEM

Creation

Features

Invariants

indexing

description

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

date

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

revision

$Revision: 1.5 $

class

EM_THREAD_CALLBACK

inherit

INT_VOIDP_ANONYMOUS_CALLBACK_CALLBACK
EM_THREAD_SUBSYSTEM

create

make

-- make

feature -- Initialisation

make

-- make

feature -- Status report

is_enabled: BOOLEAN

-- Is the thread subsystem enabled?

-- (From EM_SUBSYSTEM)

feature --setter

dummy: INTEGER

-- out dummy function

set_dummy

-- sets a dummy function for thread execution... just to see what happens / debugging...

set_function (a_function: like function)

-- sets the function which will be executed

feature -- Subsystem management

base_disable

-- Disable basic systems.

-- (From EM_SUBSYSTEM)

base_enable

-- Enable basic systems.

-- (From EM_SUBSYSTEM)

disable

-- Disable EiffelMedia thread subsystem.

-- (From EM_SUBSYSTEM)

require
enabled: is_enabled
ensure then
disabled: not is_enabled
enable

-- Enable EiffelMedia thread subsystem.

-- (From EM_SUBSYSTEM)

require
not_enabled: not is_enabled
enabled_subsystem_count: DS_CELL [INTEGER]

-- Count of enabled subsystems

-- (From EM_SUBSYSTEM)

feature -- callback

on_callback (data: POINTER): INTEGER

-- gets called by the thread creation procedure

-- (From INT_VOIDP_ANONYMOUS_CALLBACK_CALLBACK)

feature -- needed: a working mutex to lock the whole thread subsystem!

io_system: EM_MUTEX

-- mutex to lock the whole thread_system

-- (From EM_THREAD_SUBSYSTEM)

thread_creation: EM_SEMAPHORE

-- semaphore to lock the whole thread_system. i think we need this, because we only have one callback singleton ...
-- (i could be wrong though ;)

-- (From EM_THREAD_SUBSYSTEM)

feature -- lowlevel callback dispatcher

dispatcher: INT_VOIDP_ANONYMOUS_CALLBACK_DISPATCHER
receiver: EM_THREAD_CALLBACK

-- on_callback is called whenever a new thread is created!

-- (From EM_THREAD_SUBSYSTEM)

invariant


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

end