19 |
* along with this program ; if not, write to the Free Software |
* along with this program ; if not, write to the Free Software |
20 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 |
* |
* |
22 |
* $Id: xvid.c,v 1.78 2008-11-28 18:16:42 Isibaar Exp $ |
* $Id: xvid.c,v 1.79 2008-11-30 16:36:44 Isibaar Exp $ |
23 |
* |
* |
24 |
****************************************************************************/ |
****************************************************************************/ |
25 |
|
|
666 |
info->num_threads = 0; |
info->num_threads = 0; |
667 |
|
|
668 |
#if defined(_WIN32) |
#if defined(_WIN32) |
669 |
|
|
670 |
{ |
{ |
|
DWORD dwProcessAffinityMask, dwSystemAffinityMask; |
|
|
if (GetProcessAffinityMask(GetCurrentProcess(), (PDWORD_PTR) &dwProcessAffinityMask, (PDWORD_PTR) &dwSystemAffinityMask)) { |
|
|
int i; |
|
|
for(i=0; i<32; i++) { |
|
|
if ((dwProcessAffinityMask & (1<<i))) |
|
|
info->num_threads++; |
|
|
} |
|
|
if (info->num_threads == 0) { |
|
671 |
SYSTEM_INFO siSysInfo; |
SYSTEM_INFO siSysInfo; |
672 |
GetSystemInfo(&siSysInfo); |
GetSystemInfo(&siSysInfo); |
673 |
info->num_threads = siSysInfo.dwNumberOfProcessors; /* number of _logical_ cores */ |
info->num_threads = siSysInfo.dwNumberOfProcessors; /* number of _logical_ cores */ |
674 |
} |
} |
675 |
} |
|
|
} |
|
676 |
#else |
#else |
677 |
|
|
678 |
#include <unistd.h> |
#include <unistd.h> |