Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
prog:lazarus:a_etudier [27/04/2021 17:11] thierry [class(specialize TFPGMap<string, string>)] |
prog:lazarus:a_etudier [27/04/2021 17:16] (Version actuelle) thierry [TLockedEvent = specialize TThreadedData<TNotifyEvent>;] |
||
---|---|---|---|
Ligne 11: | Ligne 11: | ||
===== TLockedEvent = specialize TThreadedData<TNotifyEvent>; ===== | ===== TLockedEvent = specialize TThreadedData<TNotifyEvent>; ===== | ||
- | <code delphi> | + | <code delphi LazWebsockets\src\wsstream.pas> |
TLockedEvent = specialize TThreadedData<TNotifyEvent>; | TLockedEvent = specialize TThreadedData<TNotifyEvent>; | ||
... | ... | ||
Ligne 62: | Ligne 62: | ||
... | ... | ||
end; | end; | ||
+ | </code> | ||
+ | Avec... | ||
+ | <code delphi LazWebsockets\src\wsutils.pas> | ||
+ | { TThreadedData } | ||
+ | generic TThreadedData<T> = record | ||
+ | public type PT = ^T; | ||
+ | private | ||
+ | FData: T; | ||
+ | FLock: TRTLCriticalSection; | ||
+ | public | ||
+ | procedure Init(const AValue: T); | ||
+ | procedure Done; | ||
+ | function Lock: PT; | ||
+ | procedure Unlock; | ||
+ | end; | ||
</code> | </code> | ||