You are not logged in.
Hi there,
I see that a call to SetCurrentThreadName was added to mORMot.pas recently (http://synopse.info/fossil/info/3919591 … 53a96e6c76). Every time I debug my application I now get an EExternalException on startup - is there any way I can turn this off? I understand it can be useful but it pops up even for a simple test application. Perhaps we can IFDEF it?
Thanks,
Bernd
Offline
Weird.
On our side, SetCurrentThreadName() does not trigger any exception in the IDE.
We tried with Delphi 7, 2007, XE4 and XE7.
I've introduced NOSETTHREADNAME conditional, to be defined if you have issues when debugging your application.
See http://synopse.info/fossil/info/73ecde4f4a
Offline
Great thanks. This was using Delphi 6 - I'll test with other Delphi versions.
Offline
I use Delphi 7.1, and this was happening with my IDE too.
Offline
NOSETTHREADNAME conditional is defined by default in Synopse.inc and apparently no one uses it as it doesn't even compile without it any more.
Thread naming is quite handy feature for debugging and should be fixed and turned on by default, IMHO.
Surely the majority of users have no problem with it.
EDIT: In general it is better to have optional additional features as conditional that turns it *on*, rather that conditional that turns something *off*.
In case of NOSETTHREADNAME for example you have to modify Synopse.inc to comment out NOSETTHREADNAME
If it was simply SETTHREADNAME and it was commented out in Synopse.inc, you could simply define it in project options or another .inc file, without the need to modify Synopse.inc.
As a bonus this is more readable:
{$IFDEF SETTHREADNAME}
than this:
{$IFNDEF NOSETTHREADNAME}
Last edited by Daniel (2019-06-23 10:00:19)
Offline
The logic was initially the reverse: set the thread name by default, and let a conditional disable it if the exception is not worth it.
At some point, I disabled it because I found it annoying for a particular case.
I guess I forgot to undefine it back.
So thread name will be turned ON by default by this commit: https://synopse.info/fossil/info/03733981ad
Offline