112 |
|
|
113 |
|
{IEvents} |
114 |
|
procedure WaitForEvent; |
115 |
< |
procedure AsyncWaitForEvent(EventHandler: TEventHandler); |
115 |
> |
procedure AsyncWaitForEvent(EventHandler: TEventHandler); override; |
116 |
|
end; |
117 |
|
|
118 |
|
implementation |
195 |
|
{$ENDIF} |
196 |
|
inherited Create; |
197 |
|
{$IFDEF WINDOWS} |
198 |
< |
FEventHandler := CreateEvent(PSa,false,true,nil); |
198 |
> |
FEventHandler := CreateEvent(PSa,false,false,nil); |
199 |
|
{$ELSE} |
200 |
|
CreateGuid(GUID); |
201 |
|
FEventWaiting := TEventObject.Create(PSa,false,false,GUIDToString(GUID)); |
220 |
|
try |
221 |
|
if FOwner.FResultBuffer <> nil then |
222 |
|
Move(updated[0], FOwner.FResultBuffer[0], length); |
223 |
– |
{$IFDEF WINDOWS} |
224 |
– |
SetEvent(FEventHandler); |
225 |
– |
{$ELSE} |
226 |
– |
FEventWaiting.SetEvent; |
227 |
– |
{$ENDIF} |
223 |
|
finally |
224 |
|
FOwner.FCriticalSection.Leave |
225 |
|
end; |
226 |
+ |
// writeln('Set Event'); |
227 |
+ |
{$IFDEF WINDOWS} |
228 |
+ |
SetEvent(FEventHandler); |
229 |
+ |
{$ELSE} |
230 |
+ |
FEventWaiting.SetEvent; |
231 |
+ |
{$ENDIF} |
232 |
|
end; |
233 |
|
|
234 |
|
procedure TEventhandlerInterface.WaitForEvent; |
238 |
|
{$ELSE} |
239 |
|
FEventWaiting.WaitFor(INFINITE); |
240 |
|
{$ENDIF} |
241 |
+ |
// writeln('Event Wait Ends'); |
242 |
|
end; |
243 |
|
|
244 |
|
procedure TEventhandlerInterface.CancelWait; |
300 |
|
if FInWaitState then |
301 |
|
IBError(ibxeInEventWait,[nil]); |
302 |
|
|
301 |
– |
CreateEventBlock; |
303 |
|
FEventHandler := EventHandler; |
304 |
|
callback := @IBEventCallback; |
305 |
|
with Firebird25ClientAPI do |
318 |
|
|
319 |
|
FInWaitState := true; |
320 |
|
try |
320 |
– |
CreateEventBlock; |
321 |
|
with Firebird25ClientAPI do |
322 |
|
Call(isc_wait_for_event(StatusVector,@FDBHandle, FEventBufferlen,FEventBuffer,FResultBuffer)); |
323 |
|
finally |