Browse Source

* "transfer to linux"-commit

florian 20 years ago
parent
commit
69037eaef3
2 changed files with 10 additions and 54 deletions
  1. 6 45
      rtl/unix/cthreads.pp
  2. 4 9
      rtl/win32/tthread.inc

+ 6 - 45
rtl/unix/cthreads.pp

@@ -544,52 +544,10 @@ begin
   pthread_mutex_unlock(@p^.mutex);
 end;
 
-type tthreadmethod = procedure of object;
+type 
+	tthreadmethod = procedure of object;
 
 
-
-var
-  { event that happens when gui thread is done executing the method}
-  ExecuteEvent: PRtlEvent;
-  { guard for synchronization variables }
-  SynchronizeCritSect: TRtlCriticalSection;
-  { method to execute }
-  SynchronizeMethod: TThreadMethod;
-  { caught exception in gui thread, to be raised in calling thread }
-  SynchronizeException: Exception;
-
-procedure CheckSynchronize;
-  { assumes being called from GUI thread }
-begin
-  if SynchronizeMethod = nil then
-    exit;
-  try
-    SynchronizeMethod;
-  except
-    SynchronizeException := Exception(AcquireExceptionObject);
-  end;
-  RtlEventSetEvent(ExecuteEvent);
-end;
-
-procedure intRTLEventsync(thrdmethd: tmethod;synchronizemethodproc:TProcedure);
-
-var LocalSyncException : Exception;
-
-begin
-  EnterCriticalSection(SynchronizeCritSect);
-  SynchronizeMethod := tthreadmethod(thrdmethd);
-  SynchronizeException := nil;
-  RtlEventStartWait(ExecuteEvent);
-  SynchronizeMethodProc;
-  // wait infinitely
-  RtlEventWaitFor(ExecuteEvent);
-  SynchronizeMethod := nil;
-  LocalSyncException  := SynchronizeException;
-  LeaveCriticalSection(SynchronizeCritSect);
-  if LocalSyncException <> nil then
-    raise LocalSyncException;
-end;
-
 Function CInitThreads : Boolean;
 
 begin
@@ -681,7 +639,10 @@ finalization
 end.
 {
   $Log$
-  Revision 1.21  2005-02-14 17:13:31  peter
+  Revision 1.22  2005-02-25 21:52:07  florian
+    * "transfer to linux"-commit
+
+  Revision 1.21  2005/02/14 17:13:31  peter
     * truncate log
 
   Revision 1.20  2005/02/06 11:20:52  peter

+ 4 - 9
rtl/win32/tthread.inc

@@ -18,14 +18,6 @@ var
   ThreadCount: Integer;
   { event that happens when gui thread is done executing the method
 }
-  ExecuteEvent: PRtlEvent;
-  { guard for synchronization variables }
-  SynchronizeCritSect: TRtlCriticalSection;
-  { method to execute }
-  SynchronizeMethod: TThreadMethod;
-  { caught exception in gui thread, to be raised in calling thread }
-  SynchronizeException: Exception;
-
 
 function ThreadWndProc(Window: HWnd; AMessage:UInt; WParam : WParam; LParam: LParam): Longint; stdcall;
 
@@ -221,7 +213,10 @@ begin
 end;
 {
   $Log$
-  Revision 1.7  2005-02-25 21:41:09  florian
+  Revision 1.8  2005-02-25 21:52:07  florian
+    * "transfer to linux"-commit
+
+  Revision 1.7  2005/02/25 21:41:09  florian
     * generic tthread.synchronize
     * delphi compatible wakemainthread