diff options
author | panikon <panikon@zoho.com> | 2014-07-08 23:19:49 -0300 |
---|---|---|
committer | panikon <panikon@zoho.com> | 2014-07-08 23:19:49 -0300 |
commit | 7cd967f812ab741c41c416fb9f7c2a921c36e947 (patch) | |
tree | 19f7f296fcf58bc5fdb2854cbbf5bae70d84a07d /src/common/thread.c | |
parent | a10dd560f02642805b59c6269d7c23cd485b8dd2 (diff) | |
download | hercules-7cd967f812ab741c41c416fb9f7c2a921c36e947.tar.gz hercules-7cd967f812ab741c41c416fb9f7c2a921c36e947.tar.bz2 hercules-7cd967f812ab741c41c416fb9f7c2a921c36e947.tar.xz hercules-7cd967f812ab741c41c416fb9f7c2a921c36e947.zip |
Extracted method to obtain SYSTEM_INFO from functions in sysinfo.c
Added proper method to obtain page size in windows
Diffstat (limited to 'src/common/thread.c')
-rw-r--r-- | src/common/thread.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/common/thread.c b/src/common/thread.c index 4be37d576..933ee2c0e 100644 --- a/src/common/thread.c +++ b/src/common/thread.c @@ -10,13 +10,13 @@ #include "thread.h" +#include "../common/sysinfo.h" // sysinfo->getpagesize() #include "../common/cbasetypes.h" #include "../common/malloc.h" #include "../common/showmsg.h" #ifdef WIN32 # include "../common/winapi.h" -# define getpagesize() 4096 // @TODO: implement this properly (GetSystemInfo .. dwPageSize..). (Atm as on all supported win platforms its 4k its static.) # define __thread __declspec( thread ) #else # include <pthread.h> @@ -32,7 +32,6 @@ #define HAS_TLS #endif - #define RA_THREADS_MAX 64 struct rAthread { @@ -170,7 +169,7 @@ rAthread rathread_createEx( rAthreadProc entryPoint, void *param, size_t szSta // given stacksize aligned to systems pagesize? - tmp = szStack % getpagesize(); + tmp = szStack % sysinfo->getpagesize(); if(tmp != 0) szStack += tmp; |