mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-19 14:09:22 +02:00
* GetCPUCount implementation for OS/2 added
git-svn-id: trunk@23233 -
This commit is contained in:
parent
962cf1ea10
commit
e256311188
@ -28,6 +28,7 @@ interface
|
|||||||
|
|
||||||
{$DEFINE OS2EXCEPTIONS}
|
{$DEFINE OS2EXCEPTIONS}
|
||||||
{$define DISABLE_NO_THREAD_MANAGER}
|
{$define DISABLE_NO_THREAD_MANAGER}
|
||||||
|
{$DEFINE HAS_GETCPUCOUNT}
|
||||||
|
|
||||||
{$I systemh.inc}
|
{$I systemh.inc}
|
||||||
|
|
||||||
|
@ -170,6 +170,10 @@ function DosQuerySysState (EntityList, EntityLevel, PID, TID: cardinal;
|
|||||||
var Buffer; BufLen: cardinal): cardinal; cdecl;
|
var Buffer; BufLen: cardinal): cardinal; cdecl;
|
||||||
external 'DOSCALLS' index 368;
|
external 'DOSCALLS' index 368;
|
||||||
|
|
||||||
|
function DosQuerySysInfo (First, Last: cardinal; var Buf; BufSize: cardinal):
|
||||||
|
cardinal; cdecl;
|
||||||
|
external 'DOSCALLS' index 348;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{*****************************************************************************
|
{*****************************************************************************
|
||||||
@ -707,6 +711,19 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{$DEFINE HAS_GETCPUCOUNT}
|
||||||
|
function GetCPUCount: LongWord;
|
||||||
|
const
|
||||||
|
svNumProcessors = 26;
|
||||||
|
var
|
||||||
|
ProcNum: cardinal;
|
||||||
|
begin
|
||||||
|
GetCPUCount := 1;
|
||||||
|
if DosQuerySysInfo (svNumProcessors, svNumProcessors, ProcNum,
|
||||||
|
SizeOf (ProcNum)) = 0 then
|
||||||
|
GetCPUCount := ProcNum;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
var
|
var
|
||||||
OS2ThreadManager: TThreadManager;
|
OS2ThreadManager: TThreadManager;
|
||||||
|
Loading…
Reference in New Issue
Block a user