亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? threadex.c

?? C標(biāo)準(zhǔn)庫(kù)源代碼,能提高對(duì)C的理解,不錯(cuò)的哦
?? C
字號(hào):
/***
*threadex.c - Extended versions of Begin (Create) and End (Exit) a Thread
*
*       Copyright (c) 1989-1997, Microsoft Corporation. All rights reserved.
*
*Purpose:
*       This source contains the _beginthreadex() and _endthreadex()
*       routines which are used to start and terminate a thread.  These
*       routines are more like the Win32 APIs CreateThread() and ExitThread()
*       than the original functions _beginthread() & _endthread() were.
*
*******************************************************************************/

#ifdef _MT

#include <cruntime.h>
#include <oscalls.h>
#include <internal.h>
#include <mtdll.h>
#include <msdos.h>
#include <malloc.h>
#include <process.h>
#include <rterr.h>
#include <dbgint.h>

/*
 * Startup code for new thread.
 */
static unsigned long WINAPI _threadstartex(void *);

/*
 * declare pointers to per-thread FP initialization and termination routines
 */
_PVFV _FPmtinit;
_PVFV _FPmtterm;


/***
*_beginthreadex() - Create a child thread
*
*Purpose:
*       Create a child thread.
*
*Entry:
*       *** Same parameters as the Win32 API CreateThread() ***
*       security = security descriptor for the new thread
*       stacksize = size of stack
*       initialcode = pointer to thread's startup code address
*               must be a __stdcall function returning an unsigned.
*       argument = argument to be passed to new thread
*       createflag = flag to create thread in a suspended state
*       thrdaddr = points to an int to receive the ID of the new thread
*
*Exit:
*       *** Same as the Win32 API CreateThread() ***
*
*       success = handle for new thread if successful
*
*       failure = 0 in case of error, errno and _doserrno are set
*
*Exceptions:
*
*Notes:
*       This routine is more like the Win32 API CreateThread() than it
*       is like the C run-time routine _beginthread().  Ditto for
*       _endthreadex() and the Win32 API ExitThread() versus _endthread().
*
*       Differences between _beginthread/_endthread and the "ex" versions:
*
*         1)  _beginthreadex takes the 3 extra parameters to CreateThread
*             which are lacking in _beginthread():
*               A) security descriptor for the new thread
*               B) initial thread state (running/asleep)
*               C) pointer to return ID of newly created thread
*
*         2)  The routine passed to _beginthread() must be __cdecl and has
*             no return code, but the routine passed to _beginthreadex()
*             must be __stdcall and returns a thread exit code.  _endthread
*             likewise takes no parameter and calls ExitThread() with a
*             parameter of zero, but _endthreadex() takes a parameter as
*             thread exit code.
*
*         3)  _endthread implicitly closes the handle to the thread, but
*             _endthreadex does not!
*
*         4)  _beginthread returns -1 for failure, _beginthreadex returns
*             0 for failure (just like CreateThread).
*
*******************************************************************************/

unsigned long __cdecl _beginthreadex (
        void *security,
        unsigned stacksize,
        unsigned (__stdcall * initialcode) (void *),
        void * argument,
        unsigned createflag,
        unsigned *thrdaddr
        )
{
        _ptiddata ptd;                  /* pointer to per-thread data */
        unsigned long thdl;             /* thread handle */
        unsigned long errcode = 0L;     /* Return from GetLastError() */

        /*
         * Allocate and initialize a per-thread data structure for the to-
         * be-created thread.
         */
        if ( (ptd = _calloc_crt(1, sizeof(struct _tiddata))) == NULL )
                goto error_return;

        /*
         * Initialize the per-thread data
         */

        _initptd(ptd);

        ptd->_initaddr = (void *) initialcode;
        ptd->_initarg = argument;
        ptd->_thandle = (unsigned long)(-1L);

        /*
         * Create the new thread using the parameters supplied by the caller.
         */
        if ( (thdl = (unsigned long)
              CreateThread( security,
                            stacksize,
                            _threadstartex,
                            (LPVOID)ptd,
                            createflag,
                            thrdaddr))
             == 0L )
        {
                errcode = GetLastError();
                goto error_return;
        }

        /*
         * Good return
         */
        return(thdl);

        /*
         * Error return
         */
error_return:
        /*
         * Either ptd is NULL, or it points to the no-longer-necessary block
         * calloc-ed for the _tiddata struct which should now be freed up.
         */
        _free_crt(ptd);

        /*
         * Map the error, if necessary.
         *
         * Note: this routine returns 0 for failure, just like the Win32
         * API CreateThread, but _beginthread() returns -1 for failure.
         */
        if ( errcode != 0L )
                _dosmaperr(errcode);

        return((unsigned long)0L);
}


/***
*_threadstartex() - New thread begins here
*
*Purpose:
*       The new thread begins execution here.  This routine, in turn,
*       passes control to the user's code.
*
*Entry:
*       void *ptd       = pointer to _tiddata structure for this thread
*
*Exit:
*       Never returns - terminates thread!
*
*Exceptions:
*
*******************************************************************************/

static unsigned long WINAPI _threadstartex (
        void * ptd
        )
{
        /*
         * Stash the pointer to the per-thread data stucture in TLS
         */
        if ( !TlsSetValue(__tlsindex, ptd) )
                _amsg_exit(_RT_THREAD);

        /*
         * Set the thread ID field -- parent thread cannot set it after
         * CreateThread() returns since the child thread might have run
         * to completion and already freed its per-thread data block!
         */
        ((_ptiddata) ptd)->_tid = GetCurrentThreadId();

        /*
         * Call fp initialization, if necessary
         */
        if ( _FPmtinit != NULL )
                (*_FPmtinit)();

        /*
         * Guard call to user code with a _try - _except statement to
         * implement runtime errors and signal support
         */
        __try {
                _endthreadex (
                    ( (unsigned (WINAPI *)(void *))(((_ptiddata)ptd)->_initaddr) )
                    ( ((_ptiddata)ptd)->_initarg ) ) ;
        }
        __except ( _XcptFilter(GetExceptionCode(), GetExceptionInformation()) )
        {
                /*
                 * Should never reach here
                 */
                _exit( GetExceptionCode() );

        } /* end of _try - _except */

        /*
         * Never executed!
         */
        return(0L);
}


/***
*_endthreadex() - Terminate the calling thread
*
*Purpose:
*
*Entry:
*       Thread exit code
*
*Exit:
*       Never returns!
*
*Exceptions:
*
*******************************************************************************/

void __cdecl _endthreadex (
        unsigned retcode
        )
{
        _ptiddata ptd;           /* pointer to thread's _tiddata struct */

        /*
         * Call fp termination, if necessary
         */
        if ( _FPmtterm != NULL )
                (*_FPmtterm)();

        if ( (ptd = _getptd()) == NULL )
                _amsg_exit(_RT_THREAD);

        /*
         * Free up the _tiddata structure & its subordinate buffers
         *      _freeptd() will also clear the value for this thread
         *      of the TLS variable __tlsindex.
         */
        _freeptd(ptd);

        /*
         * Terminate the thread
         */
        ExitThread(retcode);

}

#endif  /* _MT */

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品在线一区二区三区| 久久精品国产在热久久| 日韩欧美一区二区视频| fc2成人免费人成在线观看播放| 亚洲黄色小视频| 久久久久久久久久久久久夜| 欧美色图片你懂的| 高清日韩电视剧大全免费| 偷拍与自拍一区| 国产精品久久久久久久久久久免费看| 91麻豆精品国产91久久久使用方法| 成人综合日日夜夜| 久久国产精品免费| 亚洲高清视频在线| 亚洲欧美一区二区在线观看| 欧美不卡一区二区| 欧美喷水一区二区| 在线观看日韩av先锋影音电影院| 福利电影一区二区| 久久草av在线| 日本女优在线视频一区二区 | 欧美福利视频一区| av在线不卡网| 成人综合在线视频| 国产一区二区三区四区五区入口 | 日本伊人午夜精品| 夜夜揉揉日日人人青青一国产精品| 中文字幕欧美区| 精品国产成人系列| 日韩欧美一区二区在线视频| 欧美三级视频在线| 在线欧美一区二区| 99久久综合99久久综合网站| 国产精品1024| 激情文学综合丁香| 久久99精品一区二区三区| 青青草成人在线观看| 日韩成人一区二区三区在线观看| 亚洲国产一区二区三区青草影视| 亚洲美女区一区| 伊人色综合久久天天| 国产精品美日韩| 中文字幕不卡的av| 国产精品国产三级国产普通话三级 | 亚洲一二三四区| 亚洲精品v日韩精品| 亚洲欧美一区二区久久| 亚洲黄色av一区| 亚洲第一主播视频| 日本成人在线视频网站| 天堂va蜜桃一区二区三区漫画版| 无吗不卡中文字幕| 乱一区二区av| 国产精品一线二线三线精华| 九九精品一区二区| 国产成人日日夜夜| 99久久免费国产| 91国偷自产一区二区使用方法| 91成人免费网站| 欧美一区二区三区小说| 精品福利在线导航| 国产精品乱码妇女bbbb| 亚洲人吸女人奶水| 亚洲小少妇裸体bbw| 日韩国产精品91| 久久99这里只有精品| 国产精品一区二区三区四区| 成人深夜在线观看| 欧洲在线/亚洲| 51精品久久久久久久蜜臀| 日韩精品一区二区在线观看| 国产午夜亚洲精品理论片色戒 | 蜜臀国产一区二区三区在线播放| 狠狠v欧美v日韩v亚洲ⅴ| 成人一区二区三区视频在线观看| 色视频欧美一区二区三区| 欧美精品三级在线观看| 欧美v日韩v国产v| 亚洲三级理论片| 日韩av在线发布| 成人一二三区视频| 欧美精品第1页| 久久久久久亚洲综合影院红桃 | 555www色欧美视频| 久久免费国产精品| 亚洲成av人**亚洲成av**| 精品中文字幕一区二区| 99国产精品久久久久久久久久| 欧美日韩在线观看一区二区 | 日本精品免费观看高清观看| 日韩欧美国产电影| 亚洲人午夜精品天堂一二香蕉| 日本美女一区二区| 色呦呦国产精品| 久久午夜羞羞影院免费观看| 亚洲一区在线观看视频| 国产成人精品aa毛片| 91精品一区二区三区在线观看| 中文字幕一区二区三区视频| 久久精品免费观看| 一本色道久久综合亚洲91| 欧美精品一区二区三区视频| 亚洲一卡二卡三卡四卡五卡| 从欧美一区二区三区| 日韩精品一区二区三区三区免费| 亚洲精品国久久99热| 国产一区二区三区综合| 欧美一区二区三区啪啪| 一区二区三区在线观看视频| 国产a视频精品免费观看| 正在播放亚洲一区| 亚洲欧洲三级电影| 国产一区二区三区黄视频| 欧美日韩国产一二三| 亚洲人成精品久久久久| 成人丝袜高跟foot| 久久综合成人精品亚洲另类欧美| 亚洲成人激情av| 欧美性大战久久久久久久蜜臀 | 国产亚洲综合色| 日韩av成人高清| 在线免费观看日本一区| 中文字幕一区二区三| 国产精品99久久久久久有的能看 | 亚洲亚洲人成综合网络| 91麻豆国产精品久久| 国产精品美女久久福利网站 | www.欧美色图| 国产女主播在线一区二区| 久久99热99| 日韩欧美一级在线播放| 日韩电影在线观看一区| 欧美精品乱码久久久久久按摩| 亚洲国产成人av| 欧美日韩精品系列| 天堂资源在线中文精品| 欧美日韩国产免费| 亚洲电影一区二区三区| 欧美另类z0zxhd电影| 日韩成人免费电影| 日韩亚洲欧美在线观看| 免费成人美女在线观看.| 日韩欧美不卡一区| 国产最新精品精品你懂的| 亚洲精品在线一区二区| 精品一区二区三区免费观看 | 91麻豆精品国产综合久久久久久| 日本大胆欧美人术艺术动态| 日韩写真欧美这视频| 七七婷婷婷婷精品国产| 精品sm捆绑视频| 国产精品一区二区在线观看网站 | 亚洲精品免费在线观看| 色综合久久天天| 亚洲黄网站在线观看| 欧美剧情片在线观看| 日本aⅴ免费视频一区二区三区| 欧美一区午夜视频在线观看| 久久福利资源站| 国产三级一区二区三区| 99久久99久久久精品齐齐| 亚洲激情五月婷婷| 欧美酷刑日本凌虐凌虐| 久久精品国产在热久久| 国产精品色婷婷久久58| 91麻豆免费在线观看| 亚洲18影院在线观看| 精品sm捆绑视频| 91亚洲精品乱码久久久久久蜜桃| 亚洲午夜免费福利视频| 日韩三级在线免费观看| 国产精品正在播放| 一区二区三区四区在线播放| 91精品国产综合久久久蜜臀粉嫩| 国产自产2019最新不卡| 亚洲欧美一区二区在线观看| 欧美精品 日韩| 成人理论电影网| 日韩av中文字幕一区二区| 亚洲国产成人一区二区三区| 欧美性一二三区| 精品一区二区三区在线观看国产| 中文字幕一区二区在线播放| 56国语精品自产拍在线观看| 成人在线一区二区三区| 天堂久久一区二区三区| 中文字幕中文字幕在线一区 | 国产日韩欧美在线一区| 91国产视频在线观看| 国产综合色在线| 亚洲国产精品久久久久婷婷884| 久久精品夜色噜噜亚洲a∨| 色婷婷综合在线| 国产一区二区按摩在线观看| 亚洲国产一区二区a毛片| 国产亚洲成av人在线观看导航| 欧美三级一区二区| 成人黄色免费短视频| 美美哒免费高清在线观看视频一区二区| 亚洲天堂精品视频|