View Issue Details

IDProjectCategoryView StatusLast Update
0036699FPCRTLpublic2020-02-15 20:42
ReporterNoNameAssigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product VersionProduct Build 
Target VersionFixed in Version 
Summary0036699: Add TMonitor record
DescriptionFor Delphi compatibility the TMonitor (http://docwiki.embarcadero.com/Libraries/Rio/en/System.TMonitor) should be added.
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Activities

Thaddy de Koning

2020-02-15 09:57

reporter   ~0121104

This also need implementation, not just declaration.
It also depends on two features of Delphi that are not implemented in FreePascal yet:
- Volatile as attribute instead of intrinsic (Documented that this will be resolved in the future)
- Anonymous methods. (Status unknown)

Also note that the TMonitor implementation of Delphi has a myriad of open and serious bugs, even in 10.3 Rio. See their bugtracker.

Although I agree it should be implemented at some point it is not that easy.

Sven Barth

2020-02-15 20:42

manager   ~0121112

@Thaddy: you're wrong on both accounts.

The Volatile attribute can easily be handled by using the Volatile intrinsic for each read and write access to FLockCount.

I don't see any use of anonymous functions in the declaration of TMonitor, thus even if Delphi's implementation should use them internally they are not strictly necessary and can be worked around (which would probably be for the best as anonymous functions are rather heavy weight and TMonitor is supposed to be more lightweight).

The main annoyance of TMonitor is that it adds an additional pointer sized field to each TObject instance. Though that *could* be worked around by storing a mapping between instances and monitors in a map as the whole GetMonitor and friends stuff of TMonitor is declared as private.

Issue History

Date Modified Username Field Change
2020-02-13 22:36 NoName New Issue
2020-02-15 09:57 Thaddy de Koning Note Added: 0121104
2020-02-15 20:42 Sven Barth Note Added: 0121112