Forum > Free Pascal

FPC 3.2.x series branched, trunk update to 3.3.1

<< < (41/41)

Seenkao:
When using native methods and critical sections, "cthreads" should be set at the very beginning (very first) module. Otherwise, a conflict arises, accompanied by (RunError 211).

in FPC 3.0.4 - it was not necessary.

PascalDragon:

--- Quote from: Seenkao on August 11, 2020, 06:13:33 am ---When using native methods and critical sections, "cthreads" should be set at the very beginning (very first) module. Otherwise, a conflict arises, accompanied by (RunError 211).

in FPC 3.0.4 - it was not necessary.

--- End quote ---

What platform? Only on Windows it isn't necessary, but on *nix platforms it has always been necessary.

Seenkao:

--- Quote from: PascalDragon on August 11, 2020, 09:22:07 am ---What platform?

--- End quote ---

All unix.


--- Quote from: PascalDragon on August 11, 2020, 09:22:07 am ---but on *nix platforms it has always been necessary.

--- End quote ---

No, in FPC <= 3.0.4, there was no need to use it at the beginning (in the launched module), it was enough to indicate in the module which one it is using.

(Нет, в FPC <= 3.0.4 не было необходимости использовать в начале (в запускаемом модуле), достаточно было указать в модуле его используещего.)

my fault,
I'm sorry.

PascalDragon:

--- Quote from: Seenkao on August 11, 2020, 05:08:27 pm ---
--- Quote from: PascalDragon on August 11, 2020, 09:22:07 am ---but on *nix platforms it has always been necessary.

--- End quote ---

No, in FPC <= 3.0.4, there was no need to use it at the beginning (in the launched module), it was enough to indicate in the module which one it is using.

--- End quote ---

That might have worked by accident, but it was always assumed that the cthreads unit is only used in the main project file and as "left-most" as possible, that is because the unit sets up a global thread manager. If you now use a different unit before that which creates a thread or critical section or event or whatever then this will fail. Maybe you had a unit that didn't create such a construct in 3.0.4, but it does now in 3.2.0.

It is documented here (and that has been there at least since it was imported into SVN 15 years ago):


--- Quote ---For linux (and other Unixes), the C thread manager can be enabled by inserting the cthreads unit in the program’s unit clause. Without this, threading programs will give an error when started. It is imperative that the unit be inserted as early in the uses clause as possible.
--- End quote ---

Navigation

[0] Message Index

[*] Previous page

Go to full version