Branch: Tag:

1999-05-08

1999-05-08 04:46:27 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

NT thread fix

Rev: src/modules/files/file.c:1.134
Rev: src/threads.c:1.87
Rev: src/threads.h:1.61

1:   /* -  * $Id: threads.h,v 1.60 1998/11/22 11:03:23 hubbe Exp $ +  * $Id: threads.h,v 1.61 1999/05/08 04:46:08 hubbe Exp $    */   #ifndef THREADS_H   #define THREADS_H
179:   #include <process.h>   #include <windows.h>    - #define THREAD_T HANDLE + #define THREAD_T unsigned   #define th_setconcurrency(X) - #define th_create(ID,fun,arg) (!(*(ID)=_beginthread(fun, 2*1024*1024, arg))) - #define th_create_small(ID,fun,arg) (!(*(ID)=_beginthread(fun, 32768, arg))) + #define th_create(ID,fun,arg) (!_beginthreadex(NULL, 2*1024*1024,fun, arg,0,ID)) + #define th_create_small(ID,fun,arg) (!_beginthreadex(NULL, 8192*sizeof(char *), fun,arg,0,ID)) + #define TH_RETURN_TYPE unsigned __stdcall   #define th_exit(foo) _endthread(foo)   #define th_join(ID,res) /******************* FIXME! ****************/   #define th_self() GetCurrentThread()
308:   #endif /* THREAD_TRACE */   };    + #ifndef TH_RETURN_TYPE + #define TH_RETURN_TYPE void * + #endif +    #ifndef th_destroy   #define th_destroy(X)   #endif
486:      /* Prototypes begin here */   struct thread_starter; - void *new_thread_func(void * data); + TH_RETURN_TYPE new_thread_func(void * data);   void f_thread_create(INT32 args);   void f_thread_set_concurrency(INT32 args);   void f_this_thread(INT32 args);