mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 04:49:19 +02:00
* more case fixes, mantis #32832 manually done.
git-svn-id: trunk@38865 -
This commit is contained in:
parent
8da8b956b0
commit
8c854cedee
@ -795,7 +795,7 @@ begin
|
|||||||
or assigned(orphaned_freelists.waitvar) or (orphaned_freelists.oscount > 0)) then
|
or assigned(orphaned_freelists.waitvar) or (orphaned_freelists.oscount > 0)) then
|
||||||
begin
|
begin
|
||||||
{$ifdef FPC_HAS_FEATURE_THREADING}
|
{$ifdef FPC_HAS_FEATURE_THREADING}
|
||||||
entercriticalsection(heap_lock);
|
EnterCriticalSection(heap_lock);
|
||||||
{$endif}
|
{$endif}
|
||||||
finish_waitfixedlist(@orphaned_freelists);
|
finish_waitfixedlist(@orphaned_freelists);
|
||||||
finish_waitvarlist(@orphaned_freelists);
|
finish_waitvarlist(@orphaned_freelists);
|
||||||
@ -821,7 +821,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{$ifdef FPC_HAS_FEATURE_THREADING}
|
{$ifdef FPC_HAS_FEATURE_THREADING}
|
||||||
leavecriticalsection(heap_lock);
|
LeaveCriticalSection(heap_lock);
|
||||||
{$endif}
|
{$endif}
|
||||||
end;
|
end;
|
||||||
if poc = nil then
|
if poc = nil then
|
||||||
@ -1105,24 +1105,24 @@ end;
|
|||||||
procedure waitfree_fixed(pmc: pmemchunk_fixed; poc: poschunk);
|
procedure waitfree_fixed(pmc: pmemchunk_fixed; poc: poschunk);
|
||||||
begin
|
begin
|
||||||
{$ifdef FPC_HAS_FEATURE_THREADING}
|
{$ifdef FPC_HAS_FEATURE_THREADING}
|
||||||
entercriticalsection(heap_lock);
|
EnterCriticalSection(heap_lock);
|
||||||
{$endif}
|
{$endif}
|
||||||
pmc^.next_fixed := poc^.freelists^.waitfixed;
|
pmc^.next_fixed := poc^.freelists^.waitfixed;
|
||||||
poc^.freelists^.waitfixed := pmc;
|
poc^.freelists^.waitfixed := pmc;
|
||||||
{$ifdef FPC_HAS_FEATURE_THREADING}
|
{$ifdef FPC_HAS_FEATURE_THREADING}
|
||||||
leavecriticalsection(heap_lock);
|
LeaveCriticalSection(heap_lock);
|
||||||
{$endif}
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure waitfree_var(pmcv: pmemchunk_var);
|
procedure waitfree_var(pmcv: pmemchunk_var);
|
||||||
begin
|
begin
|
||||||
{$ifdef FPC_HAS_FEATURE_THREADING}
|
{$ifdef FPC_HAS_FEATURE_THREADING}
|
||||||
entercriticalsection(heap_lock);
|
EnterCriticalSection(heap_lock);
|
||||||
{$endif}
|
{$endif}
|
||||||
pmcv^.next_var := pmcv^.freelists^.waitvar;
|
pmcv^.next_var := pmcv^.freelists^.waitvar;
|
||||||
pmcv^.freelists^.waitvar := pmcv;
|
pmcv^.freelists^.waitvar := pmcv;
|
||||||
{$ifdef FPC_HAS_FEATURE_THREADING}
|
{$ifdef FPC_HAS_FEATURE_THREADING}
|
||||||
leavecriticalsection(heap_lock);
|
LeaveCriticalSection(heap_lock);
|
||||||
{$endif}
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1246,11 +1246,11 @@ begin
|
|||||||
if loc_freelists^.waitfixed = nil then
|
if loc_freelists^.waitfixed = nil then
|
||||||
exit(false);
|
exit(false);
|
||||||
{$ifdef FPC_HAS_FEATURE_THREADING}
|
{$ifdef FPC_HAS_FEATURE_THREADING}
|
||||||
entercriticalsection(heap_lock);
|
EnterCriticalSection(heap_lock);
|
||||||
{$endif}
|
{$endif}
|
||||||
finish_waitfixedlist(loc_freelists);
|
finish_waitfixedlist(loc_freelists);
|
||||||
{$ifdef FPC_HAS_FEATURE_THREADING}
|
{$ifdef FPC_HAS_FEATURE_THREADING}
|
||||||
leavecriticalsection(heap_lock);
|
LeaveCriticalSection(heap_lock);
|
||||||
{$endif}
|
{$endif}
|
||||||
result := true;
|
result := true;
|
||||||
end;
|
end;
|
||||||
@ -1274,11 +1274,11 @@ begin
|
|||||||
if loc_freelists^.waitvar = nil then
|
if loc_freelists^.waitvar = nil then
|
||||||
exit;
|
exit;
|
||||||
{$ifdef FPC_HAS_FEATURE_THREADING}
|
{$ifdef FPC_HAS_FEATURE_THREADING}
|
||||||
entercriticalsection(heap_lock);
|
EnterCriticalSection(heap_lock);
|
||||||
{$endif}
|
{$endif}
|
||||||
finish_waitvarlist(loc_freelists);
|
finish_waitvarlist(loc_freelists);
|
||||||
{$ifdef FPC_HAS_FEATURE_THREADING}
|
{$ifdef FPC_HAS_FEATURE_THREADING}
|
||||||
leavecriticalsection(heap_lock);
|
LeaveCriticalSection(heap_lock);
|
||||||
{$endif}
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1518,9 +1518,9 @@ var
|
|||||||
begin
|
begin
|
||||||
if heap_lock_use > 0 then
|
if heap_lock_use > 0 then
|
||||||
begin
|
begin
|
||||||
entercriticalsection(heap_lock);
|
EnterCriticalSection(heap_lock);
|
||||||
inc(heap_lock_use);
|
inc(heap_lock_use);
|
||||||
leavecriticalsection(heap_lock);
|
LeaveCriticalSection(heap_lock);
|
||||||
end;
|
end;
|
||||||
loc_freelists := @freelists;
|
loc_freelists := @freelists;
|
||||||
fillchar(loc_freelists^,sizeof(tfreelists),0);
|
fillchar(loc_freelists^,sizeof(tfreelists),0);
|
||||||
@ -1589,7 +1589,7 @@ begin
|
|||||||
{$ifdef FPC_HAS_FEATURE_THREADING}
|
{$ifdef FPC_HAS_FEATURE_THREADING}
|
||||||
if heap_lock_use > 0 then
|
if heap_lock_use > 0 then
|
||||||
begin
|
begin
|
||||||
entercriticalsection(heap_lock);
|
EnterCriticalSection(heap_lock);
|
||||||
finish_waitfixedlist(loc_freelists);
|
finish_waitfixedlist(loc_freelists);
|
||||||
finish_waitvarlist(loc_freelists);
|
finish_waitvarlist(loc_freelists);
|
||||||
end;
|
end;
|
||||||
@ -1622,9 +1622,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
dec(heap_lock_use);
|
dec(heap_lock_use);
|
||||||
last_thread := heap_lock_use = 0;
|
last_thread := heap_lock_use = 0;
|
||||||
leavecriticalsection(heap_lock);
|
LeaveCriticalSection(heap_lock);
|
||||||
if last_thread then
|
if last_thread then
|
||||||
donecriticalsection(heap_lock);
|
DoneCriticalSection(heap_lock);
|
||||||
end;
|
end;
|
||||||
{$endif}
|
{$endif}
|
||||||
{$ifdef SHOW_MEM_USAGE}
|
{$ifdef SHOW_MEM_USAGE}
|
||||||
|
@ -269,65 +269,65 @@ begin
|
|||||||
result:=currenttm.BasicEventCreate(EventAttributes,AManualReset,InitialState, Name);
|
result:=currenttm.BasicEventCreate(EventAttributes,AManualReset,InitialState, Name);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure basiceventdestroy(state:peventstate);
|
procedure BasicEventDestroy(state:peventstate);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
currenttm.basiceventdestroy(state);
|
currenttm.BasicEventDestroy(state);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure basiceventResetEvent(state:peventstate);
|
procedure BasicEventResetEvent(state:peventstate);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
currenttm.basiceventResetEvent(state);
|
currenttm.BasicEventResetEvent(state);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure basiceventSetEvent(state:peventstate);
|
procedure BasicEventSetEvent(state:peventstate);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
currenttm.basiceventSetEvent(state);
|
currenttm.BasicEventSetEvent(state);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function basiceventWaitFor(Timeout : Cardinal;state:peventstate) : longint;
|
function BasicEventWaitFor(Timeout : Cardinal;state:peventstate) : longint;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
result:=currenttm.basiceventWaitFor(Timeout,state);
|
result:=currenttm.BasicEventWaitFor(Timeout,state);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function RTLEventCreate :PRTLEvent;
|
function RTLEventCreate :PRTLEvent;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
result:=currenttm.rtleventcreate();
|
result:=currenttm.RTLEventCreate();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure RTLeventdestroy(state:pRTLEvent);
|
procedure RTLeventDestroy(state:pRTLEvent);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
currenttm.rtleventdestroy(state);
|
currenttm.RTLEventDestroy(state);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure RTLeventSetEvent(state:pRTLEvent);
|
procedure RTLeventSetEvent(state:pRTLEvent);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
currenttm.rtleventsetEvent(state);
|
currenttm.RTLEventSetEvent(state);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure RTLeventResetEvent(state:pRTLEvent);
|
procedure RTLeventResetEvent(state:pRTLEvent);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
currenttm.rtleventResetEvent(state);
|
currenttm.RTLEventResetEvent(state);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure RTLeventWaitFor(state:pRTLEvent);
|
procedure RTLeventWaitFor(state:pRTLEvent);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
currenttm.rtleventWaitFor(state);
|
currenttm.RTLEventWaitFor(state);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure RTLeventWaitFor(state:pRTLEvent;timeout : longint);
|
procedure RTLeventWaitFor(state:pRTLEvent;timeout : longint);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
currenttm.rtleventWaitForTimeout(state,timeout);
|
currenttm.RTLEventWaitForTimeout(state,timeout);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ ---------------------------------------------------------------------
|
{ ---------------------------------------------------------------------
|
||||||
@ -521,16 +521,16 @@ const
|
|||||||
AllocateThreadVars : @NoThreadError;
|
AllocateThreadVars : @NoThreadError;
|
||||||
ReleaseThreadVars : @NoThreadError;
|
ReleaseThreadVars : @NoThreadError;
|
||||||
BasicEventCreate : TBasicEventCreateHandler(@NoThreadError);
|
BasicEventCreate : TBasicEventCreateHandler(@NoThreadError);
|
||||||
basiceventdestroy : TBasicEventHandler(@NoThreadError);
|
BasicEventdestroy : TBasicEventHandler(@NoThreadError);
|
||||||
basiceventResetEvent : TBasicEventHandler(@NoThreadError);
|
BasicEventResetEvent : TBasicEventHandler(@NoThreadError);
|
||||||
basiceventSetEvent : TBasicEventHandler(@NoThreadError);
|
BasicEventSetEvent : TBasicEventHandler(@NoThreadError);
|
||||||
basiceventWaitFor : TBasicEventWaitForHandler(@NoThreadError);
|
BasicEventWaitFor : TBasicEventWaitForHandler(@NoThreadError);
|
||||||
rtlEventCreate : TRTLCreateEventHandler(@NoThreadError);
|
RTLEventCreate : TRTLCreateEventHandler(@NoThreadError);
|
||||||
rtleventdestroy : TRTLEventHandler(@NoThreadError);
|
RTLEventdestroy : TRTLEventHandler(@NoThreadError);
|
||||||
rtleventSetEvent : TRTLEventHandler(@NoThreadError);
|
RTLEventSetEvent : TRTLEventHandler(@NoThreadError);
|
||||||
rtleventResetEvent : TRTLEventHandler(@NoThreadError);
|
RTLEventResetEvent : TRTLEventHandler(@NoThreadError);
|
||||||
rtleventWaitFor : TRTLEventHandler(@NoThreadError);
|
RTLEventWaitFor : TRTLEventHandler(@NoThreadError);
|
||||||
rtleventwaitfortimeout : TRTLEventHandlerTimeout(@NoThreadError);
|
RTLEventwaitfortimeout : TRTLEventHandlerTimeout(@NoThreadError);
|
||||||
{$else EMBEDDED}
|
{$else EMBEDDED}
|
||||||
BeginThread : @NoBeginThread;
|
BeginThread : @NoBeginThread;
|
||||||
EndThread : @NoEndThread;
|
EndThread : @NoEndThread;
|
||||||
@ -553,16 +553,16 @@ const
|
|||||||
AllocateThreadVars : @NoThreadError;
|
AllocateThreadVars : @NoThreadError;
|
||||||
ReleaseThreadVars : @NoThreadError;
|
ReleaseThreadVars : @NoThreadError;
|
||||||
BasicEventCreate : @NoBasicEventCreate;
|
BasicEventCreate : @NoBasicEventCreate;
|
||||||
basiceventdestroy : @NoBasicEvent;
|
BasicEventDestroy : @NoBasicEvent;
|
||||||
basiceventResetEvent : @NoBasicEvent;
|
BasicEventResetEvent : @NoBasicEvent;
|
||||||
basiceventSetEvent : @NoBasicEvent;
|
BasicEventSetEvent : @NoBasicEvent;
|
||||||
basiceventWaitFor : @NoBasiceventWaitFor;
|
BasicEventWaitFor : @NoBasiceventWaitFor;
|
||||||
rtlEventCreate : @NoRTLEventCreate;
|
RTLEventCreate : @NoRTLEventCreate;
|
||||||
rtleventdestroy : @NoRTLevent;
|
RTLEventDestroy : @NoRTLevent;
|
||||||
rtleventSetEvent : @NoRTLevent;
|
RTLEventSetEvent : @NoRTLevent;
|
||||||
rtleventResetEvent : @NoRTLEvent;
|
RTLEventResetEvent : @NoRTLEvent;
|
||||||
rtleventWaitFor : @NoRTLEvent;
|
RTLEventWaitFor : @NoRTLEvent;
|
||||||
rtleventwaitfortimeout : @NoRTLEventWaitForTimeout;
|
RTLEventWaitforTimeout : @NoRTLEventWaitForTimeout;
|
||||||
{$endif EMBEDDED}
|
{$endif EMBEDDED}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -158,15 +158,15 @@ procedure EnterCriticalSection(var cs : TRTLCriticalSection);
|
|||||||
procedure LeaveCriticalSection(var cs : TRTLCriticalSection);
|
procedure LeaveCriticalSection(var cs : TRTLCriticalSection);
|
||||||
function TryEnterCriticalSection(var cs : TRTLCriticalSection):longint;
|
function TryEnterCriticalSection(var cs : TRTLCriticalSection):longint;
|
||||||
function BasicEventCreate(EventAttributes : Pointer; AManualReset,InitialState : Boolean;const Name : ansistring):pEventState;
|
function BasicEventCreate(EventAttributes : Pointer; AManualReset,InitialState : Boolean;const Name : ansistring):pEventState;
|
||||||
procedure basiceventdestroy(state:peventstate);
|
procedure BasicEventDestroy(state:peventstate);
|
||||||
procedure basiceventResetEvent(state:peventstate);
|
procedure BasicEventResetEvent(state:peventstate);
|
||||||
procedure basiceventSetEvent(state:peventstate);
|
procedure BasicEventSetEvent(state:peventstate);
|
||||||
function basiceventWaitFor(Timeout : Cardinal;state:peventstate) : longint;
|
function BasicEventWaitFor(Timeout : Cardinal;state:peventstate) : longint;
|
||||||
|
|
||||||
function RTLEventCreate :PRTLEvent;
|
function RTLEventCreate :PRTLEvent;
|
||||||
procedure RTLeventdestroy(state:pRTLEvent);
|
procedure RTLEventDestroy(state:pRTLEvent);
|
||||||
procedure RTLeventSetEvent(state:pRTLEvent);
|
procedure RTLEventSetEvent(state:pRTLEvent);
|
||||||
procedure RTLeventResetEvent(state:pRTLEvent);
|
procedure RTLEventResetEvent(state:pRTLEvent);
|
||||||
procedure RTLeventWaitFor(state:pRTLEvent);
|
procedure RTLEventWaitFor(state:pRTLEvent);
|
||||||
procedure RTLeventWaitFor(state:pRTLEvent;timeout : longint);
|
procedure RTLEventWaitFor(state:pRTLEvent;timeout : longint);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user