锘??xml version="1.0" encoding="utf-8" standalone="yes"?>日本精品一区二区久久久,久久综合九色综合精品,漂亮人妻被黑人久久精品http://m.shnenglu.com/byc/category/15470.htmlzh-cnMon, 15 Nov 2010 20:25:33 GMTMon, 15 Nov 2010 20:25:33 GMT60pthreads-w32http://m.shnenglu.com/byc/archive/2010/11/15/133666.html鍏彾鑽?/dc:creator>鍏彾鑽?/author>Mon, 15 Nov 2010 07:41:00 GMThttp://m.shnenglu.com/byc/archive/2010/11/15/133666.htmlhttp://m.shnenglu.com/byc/comments/133666.htmlhttp://m.shnenglu.com/byc/archive/2010/11/15/133666.html#Feedback0http://m.shnenglu.com/byc/comments/commentRss/133666.htmlhttp://m.shnenglu.com/byc/services/trackbacks/133666.htmlhttp://shenan1984.blog.163.com/blog/static/2530851020098231001787/
  official site: http://sourceware.org/pthreads-win32/
  source code: ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-8-0-release.tar.gz

1. 緙栬瘧:
    铏界劧婧愮爜鍖呴噷鎻愪緵浜?jiǎn)vc6鐨勯」鐩枃浠? 浣嗘槸鎵撲笉寮鐨? 鍙兘鐢╪make. 榛樿鐨勪細(xì)鍛婅瘔浣犱竴鍫唍make鍙傛暟鐨?
    鎴戞墍瑕佺敤鐨勬槸緙栬瘧鎴恠tatic鐨刲ibrary, 鎵浠ヨ緭鍏?nmake clean VC-static", 緙栬瘧寰堝揩鐨? 涓嶈繃榛樿浼?xì)閾炬帴鍒癡C鐨刢rt, 鎴戜滑闇瑕佷慨鏀瑰畠鐨刴akefile. 鎵懼埌CFLAGS閭d竴琛? 鎶?/MD"鏀規(guī)垚"/MT".

2. 欏圭洰:
    璇?. 鏈夊ソ澶氬湴鏂硅鏀圭殑.
    a) 褰撶劧鏄痸s璺緞鐨刬nclude鍟? lib鍟?. 鑷繁鍔?
    b) 欏圭洰鐨刢rt璁劇疆鎴?/MT"鍜?/MTd". 棰濆鐨刲ib鍔? pthreadVC2(d).lib ws2_32.lib
    c) preprocesser瀹氫箟鐨勫湴鏂? 鍔犱竴涓?#8220;PTW32_STATIC_LIB”瀹? 涓嶇劧link鐨勬椂鍊欎細(xì)鎵句笉鍒皊ymbol鐨?
    d) 濂戒簡(jiǎn), 浣犲彲浠oding浜? 闅忎究pthread_create()涓鎶婂惂.

3. 緙栫爜:
    鍡棷.. 濡傛灉鐪熺殑鐩存帴pthread_create()鐨勮瘽鍙槸浼?xì)access violation鐨勫憖. win32涓嬬殑綰跨▼寰堣寮傜殑, 鍍弚insock涓鏍? 璋冪敤浠諱綍鍏跺畠鍑芥暟涔嬪墠蹇呴』璋冪敤pthread_win32_process_attach_np(), 緇撴潫鍚庡繀欏昏皟鐢╬thread_win32_process_detach_np(). 浠g爜澶ф灝辨槸榪欐牱鐨?

1. 涓嬭澆pthreads win32婧愪唬鐮侊細(xì)
    ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-8-0-release.tar.gz
2. 緙栬瘧闈?rùn)鎬佸簱錛?br>make clean GC-static
鍦ㄦ牴鐩綍涓嬮潰鐢熸垚libpthreadGC2.a
3. 灝嗙敓鎴愮殑libpthreadGC2.a鎷瘋礉鍒癿ingw搴撶洰褰曚笅錛屽皢pthread.h, sched.h, semaphore.h鎷瘋礉鍒癐NCLUDE鐩綍涓?br>4. 浣跨敤libpthread搴擄紝
鍦ㄧ▼搴忚搗濮嬪瀵筶ibpthread浣滃垵濮嬪寲錛?br>#if defined(PTW32_STATIC_LIB)
    ptw32_processInitialize();
#endif
5. 緙栬瘧鏃剁‘淇濅紶鍏?DPTW32_STATIC_LIB錛岄摼鎺ユ椂鍔犲叆-lpthreadGC2錛?OK錛?br>

http://hi.baidu.com/lff0305/blog/item/2a55e7366ebba6360b55a942.html
pthread2鎻愪緵浜?jiǎn)涓嶅悓鐨?lib浠ュ強(qiáng)鐩稿搴旂殑.dll,

pthread[VG]{SE,CE,C}c.dll
pthread[VG]{SE,CE,C}c.lib

 

鍚箟涓?br>[VG] 緙栬瘧鍣ㄧ綾?br>V    - MS VC, or
G    - GNU C

 

{SE,CE,C} 寮傚父澶勭悊妯″紡
SE    - Structured EH, or
CE    - C++ EH, or
C    - no exceptions - uses setjmp/longjmp

c    - DLL compatibility number indicating ABI and API
compatibility with applications built against
any snapshot with the same compatibility number.
See 'Version numbering' below.

   姣斿涓婇潰鐢ㄧ殑pthreadvc2.dll, 鍚箟涓?

   v = MSVC

   c = 娌℃湁浣跨敤寮傚父鏈哄埗, 鑰屾槸浣跨敤setjump/longjmp

   2 = 鍏肩敤鎬?- 鍜宲thread2鍏煎, 涓嶅拰鏃х増鏈琾thread1鍏煎.

 

   璇︾粏璇峰弬鐓thread鐨剅eadme.


http://blog.csdn.net/psusong/archive/2010/01/14/5189659.aspx

pthread 闈?rùn)鎬佺紪璇戠増鏈湪Windows涓嬩嬌鐢ㄦ椂鐨勬敞鎰忎簨欏?
浣滀負(fù)閫氱敤鐨勮法騫沖彴楂樻ц兘綰跨▼搴擄紝鍦ㄥ緢澶氳法騫沖彴鐨勯」鐩腑閮藉彲浠ョ湅瑙乸thread鐨勮韓褰便俻thread鏈韓鐨勫疄鐜版瘮杈冧紭闆咃紝APIs浣跨敤璧鋒潵涔熷緢鏂逛究銆?/p>

浣嗗湪Windows涓嬩嬌鐢ㄩ潤(rùn)鎬佺紪璇戠殑pthread鏃惰鐗瑰埆娉ㄦ剰涓涓嬶紝蹇呴』鏄懼紡鐨勮皟鐢ㄥ涓嬪洓涓嚱鏁幫紝鍚﹀垯pthread鐢ㄥ埌鐨勪竴浜涘叏灞鍙橀噺浼?xì)娌℃湁琚垵濮嬪寲锛屽D嚧鎵鏈夌殑pthread鐨凙PIs璋冪敤閮絚rash.

BOOL pthread_win32_process_attach_np (void);

BOOL pthread_win32_process_detach_np (void);

BOOL pthread_win32_thread_attach_np (void);

BOOL pthread_win32_thread_detach_np (void);

pthread瀹樻柟鏂囨。瀵規(guī)鏈夊涓嬬殑鏄庣‘璇存槑錛?/p>

These functions contain the code normally run via dllMain

when the library is used as a dll but which need to be

called explicitly by an application when the library

is statically linked.

You will need to call pthread_win32_process_attach_np() before

you can call any pthread routines when statically linking.

You should call pthread_win32_process_detach_np() before

exiting your application to clean up.

pthread_win32_thread_attach_np() is currently a no-op, but

pthread_win32_thread_detach_np() is needed to clean up

the implicit pthread handle that is allocated to a Win32 thread if

it calls certain pthreads routines. Call this routine when the

Win32 thread exits.

These functions invariably return TRUE except for

pthread_win32_process_attach_np() which will return FALSE

if pthreads-win32 initialisation fails.

閫氳繃鍑芥暟鐨勫悕瀛楁垜浠笉闅劇寽嫻嬪嚭濡備笅璋冪敤欏哄簭

鍦ㄧ▼搴忓紑濮嬬殑鏃跺欒璋冪敤錛?/p>

BOOL pthread_win32_process_attach_np (void);

BOOL pthread_win32_thread_attach_np (void);

鍦ㄧ▼搴忛鍑烘椂瑕佽皟鐢細(xì)

BOOL pthread_win32_thread_detach_np (void);

BOOL pthread_win32_process_detach_np (void);

姣旇緝閫氱敤鐨勫仛娉曟槸鍦ㄦā鍧桳oad鍜孶nLoad鐨勬椂鍊欏仛榪欎釜attach鍜宒etach鎿嶄綔錛屽涓嬮潰鎵紺猴細(xì)

/* Callback for our DLL so we can initialize pthread */

BOOL WINAPI DllMain( HANDLE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )

{

#ifdef PTW32_STATIC_LIB

    switch( fdwReason )

    {

        case DLL_PROCESS_ATTACH:

            pthread_win32_process_attach_np();

        case DLL_THREAD_ATTACH:

            pthread_win32_thread_attach_np();

            break;

        case DLL_THREAD_DETACH:

            pthread_win32_thread_detach_np();

            break;

        case DLL_PROCESS_DETACH:

            pthread_win32_thread_detach_np();

            pthread_win32_process_detach_np();

            break;

    }

#endif

    return TRUE;

}

娉ㄦ剰錛?PTW32_STATIC_LIB 瀹忎負(fù)pthread闈?rùn)鎬佺紪璇戠殑鏍囧織錛岃繖涓彲浠ラ氳繃pthread.h鐨勯厤緗垨鑰匔FLAGS浼犻掕繘鏉ャ?br>涓嬮潰鏄痯thread鐨勫畼鏂圭殑dll.c鐨勫疄鐜?br>BOOL WINAPI
DllMain (HINSTANCE hinstDll, DWORD fdwReason, LPVOID lpvReserved)
{
  BOOL result = PTW32_TRUE;
  switch (fdwReason)
    {
    case DLL_PROCESS_ATTACH:
      result = pthread_win32_process_attach_np ();
      break;
    case DLL_THREAD_ATTACH:
      /*
       * A thread is being created
       */
      result = pthread_win32_thread_attach_np ();
      break;
    case DLL_THREAD_DETACH:
      /*
       * A thread is exiting cleanly
       */
      result = pthread_win32_thread_detach_np ();
      break;
    case DLL_PROCESS_DETACH:
      (void) pthread_win32_thread_detach_np ();
      result = pthread_win32_process_detach_np ();
      break;
    }
  return (result);
} /* DllMain */
涔熷氨鏄pthread瀹樻柟浠g爜鍦ㄥ姩鎬佺紪璇戠殑鐗堟湰涓富鍔ㄥ仛浜?jiǎn)杩欎釜attach鍜宒etach鎿嶄綔銆?br>鑰岄潤(rùn)鎬佺紪璇戠増鏈敱浜庢病鏈変竴涓悎閫傜殑鍦版柟鏉ュ仛榪欎歡浜嬶紝灝卞皢attach鍜宒etach鐨勭殑鎿嶄綔鎵旂粰鐢ㄦ埛鏉ュ畬鎴愪簡(jiǎn)銆?br>涓婇潰鐨勪唬鐮佹槸閽堝璋冪敤鏂規(guī)槸Dll鐨勬儏鍐靛仛鐨勫垵濮嬪寲錛屽鏋滆皟鐢ㄦ柟涓嶆槸Dll鍛紵瀵規(guī)鍙互鍙傜収濡備笅鍋氭硶錛岃櫧鐒跺緢鏆村姏錛屼絾寰堢畝鍗曪紝鍙互宸ヤ綔
1錛夊畾涔夊涓嬪嚱鏁?br>#ifdef PTW32_STATIC_LIB
static void detach_ptw32(void)
{
    pthread_win32_thread_detach_np();
    pthread_win32_process_detach_np();
}
#endif
2錛夊湪浣犵殑涓葷▼搴忕殑鍏ュ彛澶勶紝涓鑸岃█鏄痬ain()涓仛濡備笅璋冪敤鍗沖彲
#ifdef PTW32_STATIC_LIB
    pthread_win32_process_attach_np();
    pthread_win32_thread_attach_np();
    atexit(detach_ptw32);
#endif
 
涔熷氨鏄敤atexit()灝哾etach宸ヤ綔鎸傛帴鍒扮▼搴忎腑鍘伙紝浣垮緱紼嬪簭鍦ㄩ鍑虹殑鏃跺欏彲浠ュpthread榪涜detach.



]]>
久久亚洲国产成人精品无码区| 亚洲AV无码久久| 久久亚洲AV成人无码| 久久男人中文字幕资源站| 国产日韩欧美久久| 久久天天婷婷五月俺也去| 国产A三级久久精品| 久久福利青草精品资源站| 嫩草影院久久99| 一极黄色视频久久网站| 一本大道加勒比久久综合| 欧美精品国产综合久久| 777午夜精品久久av蜜臀| 97久久精品国产精品青草| 欧美日韩精品久久久久| 国产V综合V亚洲欧美久久| 亚洲日本va午夜中文字幕久久| 中文字幕无码精品亚洲资源网久久| 久久久久无码精品国产| 亚洲精品乱码久久久久久蜜桃图片| 精品久久无码中文字幕| 中文精品99久久国产| 99久久综合狠狠综合久久止| 久久亚洲国产成人影院网站| 精品久久人妻av中文字幕| 性做久久久久久免费观看| 精品精品国产自在久久高清| 亚洲日本久久久午夜精品| 久久综合久久综合久久| 亚洲av日韩精品久久久久久a| 久久国产福利免费| 久久亚洲国产精品一区二区| 久久夜色精品国产亚洲| 欧美粉嫩小泬久久久久久久 | 亚洲精品视频久久久| 四虎国产永久免费久久| 久久亚洲日韩精品一区二区三区| 久久亚洲AV成人无码软件| 久久久久亚洲AV成人网人人网站| 91精品国产色综合久久| 国产午夜福利精品久久2021|