PreviousUpNext

15.4.1195  src/lib/std/src/threadkit/posix/threadkit-winix-io.pkg

## threadkit-winix-io.pkg

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



###              "They are ill discoverers that
###               think there is no land, when
###               they can see nothing but sea."
###
###                          -- Francis Bacon



stipulate
    package io  =  threadkit_io_manager;                                        # threadkit_io_manager          is from   src/lib/src/lib/thread-kit/src/core-thread-kit/threadkit-io-manager.pkg
    package wnx =  winix;                                                       # winix                         is from   src/lib/std/winix.pkg
    package wio =  winix::io;                                                   # winix_io                      is from   src/lib/std/src/posix/winix-io.pkg
herein

    package   threadkit_winix_io
    : (weak)  Threadkit_Winix_Io                                                # Threadkit_Winix_Io            is from   src/lib/src/lib/thread-kit/src/winix/threadkit-winix-io.api
    {

        Io_Descriptor      =  wio::Io_Descriptor;
        Io_Descriptor_Kind =  wio::Io_Descriptor_Kind;

        hash    =  wio::hash;
        compare =  wio::compare;
        kind    =  wio::kind;

        package kind
            =
            wio::kind;

        Wait_Request =  wio::Wait_Request;
        Wait_Result  =  wio::Wait_Result;

        exception BAD_WAIT_REQUEST = wio::BAD_WAIT_REQUEST;

        # Polling functions 
        #
        stipulate

            include threadkit;                                                  # threadkit                     is from   src/lib/src/lib/thread-kit/src/core-thread-kit/threadkit.pkg

            fun timeout''  duration
                =
                timeout_in'  duration
                    ==>
                    .{ []; };

            fun io_mailop  pd
                =
                io::io_mailop  pd
                    ==>
                    .{  [ #info ]; };

        herein

            fun wait_for_io_opportunity_mailop [pd] =>  io_mailop pd;
                wait_for_io_opportunity_mailop _    =>  raise exception FAIL "io::winix::poll_mailop not fully implemented";
            end;

            fun wait_for_io_opportunity ([pd], NULL)  =>  do_mailop (io_mailop pd);
                wait_for_io_opportunity ([pd], THE t) =>  select [timeout'' t, io_mailop pd];
                wait_for_io_opportunity _             =>  raise exception FAIL "io::winix::poll not fully implemented";
            end;

            # Deprecated synonyms for above, mainly so that unix
            # folks looking for 'select' in the function index
            # will get led here:
            #    
            select        =  wait_for_io_opportunity;
            select_mailop =  wait_for_io_opportunity_mailop;
        end;
    };
end;

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