@@ -4261,9 +4261,9 @@ TMultiLightLock = record
42614261 TMultiLightLock = object
42624262 { $endif USERECORDWITHMETHODS}
42634263 private
4264- Flags: PtrUInt; // is also the reentrant > 0 counter
4265- ThreadID: TThreadID; // pointer on POSIX, DWord on Windows
4266- procedure LockSpin ; // called by the Lock method when inlined
4264+ Flags: PtrUInt; // is also the reentrant > 0 counter
4265+ ThreadID: pointer; // TThreadID is pointer on POSIX, DWord on Windows
4266+ procedure LockSpin ; // called by the Lock method when inlined
42674267 public
42684268 // / to be called if the instance has not been filled with 0
42694269 // - e.g. not needed if TMultiLightLock is defined as a class field
@@ -10494,13 +10494,13 @@ procedure TCachedValue.Cache(Call: TCachedValueCall; CallParam: pointer;
1049410494procedure TMultiLightLock.Init ;
1049510495begin
1049610496 Flags := 0 ;
10497- ThreadID := TThreadID( 0 ) ;
10497+ ThreadID := nil ;
1049810498end ;
1049910499
1050010500procedure TMultiLightLock.Done ;
1050110501begin
10502- Flags := PtrUInt(- 1 ) ;
10503- ThreadID := TThreadID( 0 ) ; // invalid combination to let TryLock fail
10502+ Flags := MaxInt ;
10503+ ThreadID := nil ; // invalid combination to let TryLock fail
1050410504end ;
1050510505
1050610506procedure TMultiLightLock.Lock ;
@@ -10512,15 +10512,15 @@ procedure TMultiLightLock.Lock;
1051210512procedure TMultiLightLock.UnLock ;
1051310513begin
1051410514 if Flags = 1 then
10515- ThreadID := TThreadID( 0 ) ; // paranoid
10515+ ThreadID := nil ; // paranoid
1051610516 LockedDec(Flags, 1 );
1051710517end ;
1051810518
1051910519function TMultiLightLock.TryLock : boolean;
1052010520var
10521- tid: TThreadID ;
10521+ tid: pointer ;
1052210522begin
10523- tid := GetCurrentThreadId;
10523+ tid := pointer( GetCurrentThreadId) ;
1052410524 if Flags = 0 then // is not locked
1052510525 if LockedExc(Flags, { to=} 1 , { from=} 0 ) then // try atomic acquisition
1052610526 begin
@@ -10541,7 +10541,7 @@ function TMultiLightLock.TryLock: boolean;
1054110541procedure TMultiLightLock.ForceLock ;
1054210542begin
1054310543 Flags := MaxInt; // forced acquisition, whatever the current state is
10544- ThreadID := GetCurrentThreadId;
10544+ ThreadID := pointer( GetCurrentThreadId) ;
1054510545end ;
1054610546
1054710547function TMultiLightLock.IsLocked : boolean;
0 commit comments