summaryrefslogtreecommitdiff
path: root/ptw32_getprocessors.c
diff options
context:
space:
mode:
authorrpj <rpj>2004-05-17 01:38:02 +0000
committerrpj <rpj>2004-05-17 01:38:02 +0000
commit771465fed0cf50ee2dd790723245fc091699c324 (patch)
treed8c18d095a33fe7c4564bd90c5f313bb9e4057dd /ptw32_getprocessors.c
parent8b14911744f58cbe3730703f3fcc41cd969fd0f3 (diff)
re-indentation, bug fixes, hooks for pre-emptive async cancelation
Diffstat (limited to 'ptw32_getprocessors.c')
-rw-r--r--ptw32_getprocessors.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/ptw32_getprocessors.c b/ptw32_getprocessors.c
index 01dfa3a..bfaa82d 100644
--- a/ptw32_getprocessors.c
+++ b/ptw32_getprocessors.c
@@ -53,15 +53,20 @@
* newly initialised spinlocks will notice.
*/
int
-ptw32_getprocessors(int * count)
+ptw32_getprocessors (int *count)
{
DWORD_PTR vProcessCPUs;
DWORD_PTR vSystemCPUs;
int result = 0;
- if (GetProcessAffinityMask(GetCurrentProcess(),
- &vProcessCPUs,
- &vSystemCPUs))
+#if defined(NEED_PROCESS_AFFINITY_MASK)
+
+ *count = 1;
+
+#else
+
+ if (GetProcessAffinityMask (GetCurrentProcess (),
+ &vProcessCPUs, &vSystemCPUs))
{
DWORD_PTR bit;
int CPUs = 0;
@@ -80,5 +85,7 @@ ptw32_getprocessors(int * count)
result = EAGAIN;
}
- return(result);
+#endif
+
+ return (result);
}