|
@@ -28,6 +28,10 @@ const
|
|
|
INFINITE = Cardinal(-1);
|
|
|
|
|
|
type
|
|
|
+ ESyncObjectException = Class(Exception);
|
|
|
+ ELockException = Class(ESyncObjectException);
|
|
|
+ ELockRecursionException = Class(ESyncObjectException);
|
|
|
+
|
|
|
TWaitResult = (wrSignaled, wrTimeout, wrAbandoned, wrError);
|
|
|
|
|
|
TSynchroObject = class(TObject)
|
|
@@ -79,6 +83,9 @@ type
|
|
|
|
|
|
implementation
|
|
|
|
|
|
+Resourcestring
|
|
|
+ SErrEventCreateFailed = 'Failed to create OS basic event with name "%s"';
|
|
|
+
|
|
|
{ ---------------------------------------------------------------------
|
|
|
Real syncobjs implementation
|
|
|
---------------------------------------------------------------------}
|
|
@@ -150,6 +157,8 @@ constructor TEventObject.Create(EventAttributes : PSecurityAttributes;
|
|
|
|
|
|
begin
|
|
|
FHandle := BasicEventCreate(EventAttributes, AManualReset, InitialState, Name);
|
|
|
+ if (FHandle=Nil) then
|
|
|
+ Raise ESyncObjectException.CreateFmt(SErrEventCreateFailed,[Name]);
|
|
|
FManualReset:=AManualReset;
|
|
|
end;
|
|
|
|