diff options
author | Loïc Hoguin <[email protected]> | 2015-10-20 03:26:40 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2015-10-20 03:26:40 +0200 |
commit | 8f19fb094712dd6a871136c8522e0cf87fb3025e (patch) | |
tree | a87bb9cfdd2f08e44f2d87eb4af4bf817df5d3c4 /src/sdl.erl | |
parent | fe01cad4cc1bbe97431d999db28a2943b5f18e1c (diff) | |
download | esdl2-8f19fb094712dd6a871136c8522e0cf87fb3025e.tar.gz esdl2-8f19fb094712dd6a871136c8522e0cf87fb3025e.tar.bz2 esdl2-8f19fb094712dd6a871136c8522e0cf87fb3025e.zip |
Implement sdl:which_subsystems/0
Diffstat (limited to 'src/sdl.erl')
-rw-r--r-- | src/sdl.erl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sdl.erl b/src/sdl.erl index 5fd965f..5391d32 100644 --- a/src/sdl.erl +++ b/src/sdl.erl @@ -21,6 +21,7 @@ -export([start_subsystems/1]). -export([stop_subsystems/1]). -export([is_started/1]). +-export([which_subsystems/0]). -type error() :: {error, string()}. -export_type([error/0]). @@ -64,4 +65,9 @@ stop_subsystems(Subsystems) -> -spec is_started(subsystem()) -> boolean(). is_started(Subsystem) -> esdl2:was_init([Subsystem]), + receive {'_nif_thread_ret_', Ret} -> Ret =:= [Subsystem] end. + +-spec which_subsystems() -> [subsystem()]. +which_subsystems() -> + esdl2:was_init([]), receive {'_nif_thread_ret_', Ret} -> Ret end. |