Apps     Components     Interfaces     All Files     Source Tree     source: tos.lib.VM.interfaces.BombillaContextSynch.nc

Interface: BombillaContextSynch

Interface to Bombilla sychronization operations.

Components providing this interface:
tos.lib.VM.components.BContextSynch
tos.lib.VM.components.BContextSynchProxy

Components requiring this interface:
tos.lib.VM.components.BombillaEngineM
tos.lib.VM.contexts.ClockContextM
tos.lib.VM.contexts.OnceContextM
tos.lib.VM.contexts.RecvContextM
tos.lib.VM.opcodes.OPhaltM
tos.lib.VM.opcodes.OPsendM
tos.lib.VM.opcodes.OPsendrM
tos.lib.VM.opcodes.OPsenseM
tos.lib.VM.opcodes.OPuartM

Commands

Events

Commands - Details

isRunnable

bool isRunnable(BombillaContext *context)

Returns whether the non-running context can acquire all of the locks it needs in the shared lock set.

Parameters:

context - The non-running context whose runnability is being checked.

locks - The shared lock set.

Returns: TRUE if the context can acquire all of the locks it needs, FALSE otherwise.

obtainLocks

result_t obtainLocks(BombillaContext *caller, BombillaContext *obtainer)

The obtainer context locks its acquire set.

Parameters:

caller - The running context whose execution causes obtainer to lock its acquire set (due to triggering, yield, etc.).

obtainer - The non-running context who is to lock its acquire set.

locks - The shared lock set.

Returns: SUCCESS if obtainer locks all of the locks in its acquire set, FALSE otherwise.

releaseLocks

result_t releaseLocks(BombillaContext *caller, BombillaContext *releaser)

The releaser context unlocks its release set.

Parameters:

caller - The running context whose execution causes releaser to unlock its release set (due to triggering, yield, etc.). This is often (but not necessarily always) the same context as the releaser.

releaser - The context who is to unlock its release set.

locks - The shared lock set.

Returns: SUCCESS if releaser unlocks all of the locks in its release set, FALSE otherwise.

releaseAllLocks

result_t releaseAllLocks(BombillaContext *caller, BombillaContext *releaser)

The releaser context unlocks all locks it holds (its held set).

Parameters:

caller - The running context whose execution causes releaser to unlock its release set (due to triggering, yield, etc.). This is often (but not necessarily always) the same context as releaser.

releaser - The running context who is to unlock its held set.

locks - The shared lock set.

Returns: SUCCESS if releaser unlocks all of the locks in its held set, FALSE otherwise.