[ Advanced Control and Suspensions | Reference Manual | Alphabetic Index ]

current_suspension(?Susp)

Susp is a live (sleeping or scheduled) suspension.
Susp
A variable.

Description

Suspensions in ECLiPSe go through several stages: They are created, attached to variables or symbolic triggers, later scheduled for execution, and finally executed.

current_suspension/1 nondeterministically enumerates all current suspensions. They may be either sleeping or already scheduled for execution. It does not return any dead suspensions.

Note: Please do not use this predicate if you need all suspensions. Use suspensions/1 instead.

Modes and Determinism

Fail Conditions

Fail is there are no suspensions or if Susp is a dead suspension

Examples

[eclipse 6]: suspend(writeln(a), 3, X->inst),
        suspend(writeln(b), 5, Y->inst),
        current_suspension(S),
	get_suspension_data(S, goal, G).

X = X
Y = Y
S = 'SUSP-_393-susp'
G = writeln(b)


Delayed goals:
        writeln(a)
        writeln(b)
More (0.00s cpu) ? ;

X = X
Y = Y
S = 'SUSP-_374-susp'
G = writeln(a)


Delayed goals:
        writeln(a)
        writeln(b)
More (0.00s cpu) ? ;

No (0.01s cpu)

See Also

delayed_goals / 1, make_suspension / 3, kill_suspension / 1, schedule_suspensions / 1, schedule_suspensions / 2, suspend / 3, suspend / 4, suspensions / 1, get_suspension_data / 3