Browse Source

+ add function reference suitable overload of TThread.ForceQueue()

Sven/Sarah Barth 2 years ago
parent
commit
b2b2606e36
2 changed files with 10 additions and 0 deletions
  1. 7 0
      rtl/objpas/classes/classes.inc
  2. 3 0
      rtl/objpas/classes/classesh.inc

+ 7 - 0
rtl/objpas/classes/classes.inc

@@ -683,6 +683,13 @@ begin
   InternalQueue(aThread, aMethod, True);
   InternalQueue(aThread, aMethod, True);
 end;
 end;
 
 
+{$ifdef FPC_HAS_REFERENCE_PROCEDURE}
+class procedure TThread.ForceQueue(aThread: TThread; aMethod: TThreadProcedure); static;
+begin
+  InternalQueue(aThread, aMethod, True);
+end;
+{$endif}
+
 class procedure TThread.RemoveQueuedEvents(aThread: TThread; aMethod: TThreadMethod);
 class procedure TThread.RemoveQueuedEvents(aThread: TThread; aMethod: TThreadMethod);
 var
 var
   entry, tmpentry, lastentry: PThreadQueueEntry;
   entry, tmpentry, lastentry: PThreadQueueEntry;

+ 3 - 0
rtl/objpas/classes/classesh.inc

@@ -2009,6 +2009,9 @@ type
     class procedure Queue(aThread: TThread; AProcedure : TThreadProcedure); static;
     class procedure Queue(aThread: TThread; AProcedure : TThreadProcedure); static;
     {$endif}
     {$endif}
     class procedure ForceQueue(aThread: TThread; aMethod: TThreadMethod); inline; static;
     class procedure ForceQueue(aThread: TThread; aMethod: TThreadMethod); inline; static;
+    {$ifdef FPC_HAS_REFERENCE_PROCEDURE}
+    class procedure ForceQueue(aThread: TThread; aMethod: TThreadProcedure); inline; static;
+    {$endif}
     class procedure RemoveQueuedEvents(aThread: TThread; aMethod: TThreadMethod); static;
     class procedure RemoveQueuedEvents(aThread: TThread; aMethod: TThreadMethod); static;
     class procedure RemoveQueuedEvents(aMethod: TThreadMethod); static;
     class procedure RemoveQueuedEvents(aMethod: TThreadMethod); static;
     class procedure RemoveQueuedEvents(aThread: TThread); static;
     class procedure RemoveQueuedEvents(aThread: TThread); static;