View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0036699||FPC||Compiler||public||2020-02-13 22:36||2020-06-07 18:07|
|Summary||0036699: Add TMonitor record|
|Description||For Delphi compatibility the TMonitor (http://docwiki.embarcadero.com/Libraries/Rio/en/System.TMonitor) should be added.|
|Tags||No tags attached.|
|Fixed in Revision|
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.
@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.
Changing the category to Compiler, because of the additional pointer field.
TMonitor is a pain, I don't know who thought of this. Probably again some .Net compatibility stuff :/
I don't think that adding a mapping is a good idea, since it would seriously impact speed.
|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|
|2020-06-07 18:07||Michael Van Canneyt||Category||RTL => Compiler|
|2020-06-07 18:07||Michael Van Canneyt||FPCTarget||=> -|
|2020-06-07 18:07||Michael Van Canneyt||Note Added: 0123312|