PreviousUpNext

15.4.911  src/lib/src/lib/thread-kit/src/core-thread-kit/threadkit-debug.pkg

## threadkit-debug.pkg
#
# Debugging support for the threadkit core.

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



stipulate
    package ci  =  unsafe::mythryl_callable_c_library_interface;                        # unsafe        is from   src/lib/std/src/unsafe/unsafe.pkg
    package itt =  internal_threadkit_types;                                            # internal_threadkit_types              is from   src/lib/src/lib/thread-kit/src/core-thread-kit/internal-threadkit-types.pkg
    package tim =  time;                                                                # time                                  is from   src/lib/std/time.pkg
    package uns =  unsafe;                                                              # unsafe                                is from   src/lib/std/src/unsafe/unsafe.pkg
    #
    fun cfun  fun_name
        = 
        ci::find_c_function
          {
            lib_name => "heap",                                                         # heap                                  is from   src/c/lib/heap/libmythryl-heap.c
            fun_name
          };
herein

    package  threadkit_debug
    : (weak) Threadkit_Debug                                                            # Threadkit_Debug                       is from   src/lib/src/lib/thread-kit/src/core-thread-kit/threadkit-debug.api
    {
        say_debug =   cfun "debug" :   String -> Void;                                  # debug                                 def in    src/c/lib/heap/libmythryl-heap.c
        #
        fun say_debug_ts  msg
            =
            say_debug (cat ["[", tim::format 3 (tim::get_current_time_utc ()), "] ", msg]);

        get_current_thread =   uns::get_current_thread_register :   Void -> itt::Thread;
            

        fun say_debug_id  msg
            =
            say_debug (cat [
                itt::thread_to_string (get_current_thread()), " ", msg
              ]);
    };
end;


## COPYRIGHT (c) 1989-1991 John H. Reppy
## COPYRIGHT (c) 1995 AT&T Bell Laboratories.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2012,
## released under Gnu Public Licence version 3.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext