mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 06:49:27 +02:00
* Raise exception if BasicEventCreate fails in constructor (bug ID 30769)
git-svn-id: trunk@34988 -
This commit is contained in:
parent
975dd13dcb
commit
76f7f81c85
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user