فهرست منبع

* use the correct thread ID when checking for the main thread
* ensure that the Exception reference is Nil when appending a synchronize entry to the synchronize queue

git-svn-id: trunk@23234 -

svenbarth 12 سال پیش
والد
کامیت
70a7a09413
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      rtl/objpas/classes/classes.inc

+ 2 - 1
rtl/objpas/classes/classes.inc

@@ -241,7 +241,7 @@ end;
 procedure ThreadQueueAppend(aEntry: TThread.PThreadQueueEntry);
 begin
   { do we really need a synchronized call? }
-  if aEntry^.Thread.ThreadID = MainThreadID then begin
+  if GetCurrentThreadID = MainThreadID then begin
     ExecuteThreadQueueEntry(aEntry);
     if not Assigned(aEntry^.SyncEvent) then
       Dispose(aEntry);
@@ -305,6 +305,7 @@ class procedure TThread.Synchronize(AThread: TThread; AMethod: TThreadMethod);
     { the Synchronize event is instantiated on demand }
     AThread.InitSynchronizeEvent;
 
+    AThread.FSynchronizeEntry^.Exception := Nil;
     AThread.FSynchronizeEntry^.Method := AMethod;
     ThreadQueueAppend(AThread.FSynchronizeEntry);