89 |
|
destructor Destroy; override; |
90 |
|
|
91 |
|
{IEvents} |
92 |
< |
procedure WaitForEvent; |
92 |
> |
procedure WaitForEvent; override; |
93 |
|
procedure AsyncWaitForEvent(EventHandler: TEventHandler); override; |
94 |
|
end; |
95 |
|
|
215 |
|
begin |
216 |
|
FEventHandler.WaitForEvent; |
217 |
|
{$IFDEF EVENTDEBUG} writeln('Event Handler Ends Wait ',Terminated); {$ENDIF} |
218 |
– |
|
218 |
|
if not Terminated then |
219 |
|
FOwner.EventSignaled; |
220 |
|
end; |
301 |
|
FAttachmentIntf := DBAttachment.AttachmentIntf; |
302 |
|
FFirebird30ClientAPI := DBAttachment.Firebird30ClientAPI; |
303 |
|
FSyncEventCallback := TEventhandlerInterface.Create(self,'Sync'); |
304 |
+ |
FAsyncEventCallback := TEventhandlerInterface.Create(self,'Async'); |
305 |
+ |
FEventHandlerThread := TEventHandlerThread.Create(self,FAsyncEventCallback); |
306 |
|
end; |
307 |
|
|
308 |
|
destructor TFB30Events.Destroy; |
318 |
|
|
319 |
|
procedure TFB30Events.AsyncWaitForEvent(EventHandler: TEventHandler); |
320 |
|
begin |
320 |
– |
{Seems like we have to create a new callback object each time to avoid empty events} |
321 |
– |
if assigned(FEventHandlerThread) then |
322 |
– |
TEventHandlerThread(FEventHandlerThread).Terminate; |
323 |
– |
if assigned(FAsyncEventCallback) then TEventhandlerInterface(FAsyncEventCallback).release; |
324 |
– |
FAsyncEventCallback := TEventhandlerInterface.Create(self,'Async'); |
325 |
– |
FEventHandlerThread := TEventHandlerThread.Create(self,FAsyncEventCallback); |
321 |
|
InternalAsyncWaitForEvent(EventHandler,FAsyncEventCallback); |
322 |
|
end; |
323 |
|
|