PreviousUpNext

15.3.396  src/lib/src/lib/thread-kit/src/glue/thread-scheduler-control.api

## thread-scheduler-control.api
#

# Compiled by:
#     src/lib/std/standard.lib

stipulate
    package tim =  time;                                                                                        # time                  is from   src/lib/std/time.pkg
    package wnx =  winix__premicrothread;                                                                       # winix__premicrothread is from   src/lib/std/winix--premicrothread.pkg
herein

    # This API is implemented by:
    #
    #     src/lib/src/lib/thread-kit/src/glue/thread-scheduler-control-g.pkg

    api Thread_Scheduler_Control {
        #
        start_up_thread_scheduler:   (Void -> Void)  ->  wnx::process::Status;                                  # Arg is thunk to run.

        start_up_thread_scheduler':  tim::Time  ->  (Void -> Void)  ->  wnx::process::Status;                   # Arg1 is timeslice quantum; arg2 is thunk to run.

        run_under_thread_scheduler:     (Void -> X) -> Void;                                                    # Arg is thunk to run.
            #
            # Run given first_thread_thunk with
            # threadkit concurrency support.
            # Make life easy for the user by
            # nesting cleanly -- we start up
            # threadkit only if needed, if it
            # is already running we just run
            # the thunk and return:

#       thread_scheduler_is_running:    Void -> Bool;

        shut_down_thread_scheduler:  wnx::process::Status -> X;                                                 # wnx::process::Status == Int.

        spawn_to_disk
            :
            ( String,                                                                                           # This argument provides the filename for the saved heap image.
              # 
              (   (String, List( String ))                                                                      # This argument provides the function to run when the saved     
                  ->                                                                                            # heap image is run.
                  wnx::process::Status
              ),
              # 
              Null_Or( tim::Time )
            )
            ->
            Void;

        include api Run_At;                                                                                     # Run_At                is from   src/lib/src/lib/thread-kit/src/core-thread-kit/run-at.api
    };
end;

## COPYRIGHT (c) 1989-1991 John H. Reppy
## COPYRIGHT (c) 1996 AT&T Research.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext