PreviousUpNext

15.4.1224  src/lib/std/src/threadkit/process-result.pkg

## process-result.pkg
#
# Support functionality for
#
#     src/lib/src/lib/thread-kit/src/process-deathwatch.pkg

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



stipulate
    package md1 =  oneshot_maildrop;                                    # oneshot_maildrop              is from   src/lib/src/lib/thread-kit/src/core-thread-kit/oneshot-maildrop.pkg
    package mop =  mailop;                                              # mailop                        is from   src/lib/src/lib/thread-kit/src/core-thread-kit/mailop.pkg
herein

    # This is used only in process_deathwatch:
    #
    #     src/lib/src/lib/thread-kit/src/process-deathwatch.pkg
    #
    package process_result 
    :       Process_Result                                              # Process_Result                is from   src/lib/std/src/threadkit/process-result.api
    {
        Result_Val(X)
          #
          = EXCEPTION  Exception
          | RESULT     X
          ;

        Threadkit_Process_Result(X)
            =
            md1::Oneshot_Maildrop( Result_Val(X) );

        fun make_threadkit_process_result ()
            =
            md1::make_oneshot_maildrop ();


        fun put           (iv, v ) =  md1::put_in_oneshot (iv, RESULT    v );
        fun put_exception (iv, ex) =  md1::put_in_oneshot (iv, EXCEPTION ex);


        fun wrap (RESULT    v ) =>  v;
            wrap (EXCEPTION ex) =>  raise exception ex;
        end;


        fun get iv
            =
            wrap (md1::get_from_oneshot iv);


        fun get_mailop  iv
            =
            mop::if_then'                                               # mop::if_then' is the plain name for   mop::(==>)
                #
                (md1::get_from_oneshot' iv,  wrap);

    };
end;


## 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