{-# LANGUAGE CPP #-}
module System.Win32.Thread
( THANDLE, TID
, getCurrentThread
, suspendThread
, resumeThread
, withSuspendedThread
, getThreadId
, getCurrentThreadId
) where
import System.Win32.DebugApi
import System.Win32.Types ( failIfZero )
#include "windows_cconv.h"
getThreadId :: THANDLE -> IO TID
getThreadId = failIfZero "GetThreadId" . c_GetThreadId
getCurrentThreadId :: IO TID
getCurrentThreadId = failIfZero "GetThreadId" c_GetCurrentThreadId
foreign import WINDOWS_CCONV "windows.h GetCurrentThread"
getCurrentThread :: IO THANDLE
foreign import WINDOWS_CCONV "windows.h GetThreadId"
c_GetThreadId :: THANDLE -> IO TID
foreign import WINDOWS_CCONV "windows.h GetCurrentThreadId"
c_GetCurrentThreadId :: IO TID