Interruptible GHC

Edward Z. Yang ezyang at MIT.EDU
Fri Sep 17 23:23:40 EDT 2010


Here's what the Windows version would look like (if I could get HEAD
to build, that is :-)

void
interruptOSThread (OSThreadId id)
{
    HANDLE hdl;
    PCSIO pCSIO;
    if (!(hdl = OpenThread(THREAD_TERMINATE,FALSE,id))) {
        sysErrorBelch("interruptOSThread: OpenThread");
        stg_exit(EXIT_FAILURE);
    }
    pCSIO = (PCSIO) GetProcAddress(GetModuleHandle(TEXT("Kernel32.dll")), "CancelSynchronousIo");
    if ( NULL != pCSIO ) {
        pCSIO(hdl);
    } else {
        // Nothing to do, unfortunately
    }
}

Cheers,
Edward


More information about the Glasgow-haskell-users mailing list