Bonjour,
A votre avis, dans un setter, est-il risqué de faire comme ceci :
Ou plutôt, impérativement, comme cela :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 procedure TStefThread.SetGroupage(Value: Boolean); begin if FGroupage <> Value then begin FLogLock.Enter; try FGroupage := Value; finally FLogLock.Leave; end; end; end;
Est-il judicieux de "consommer" un TCriticalSection, si le test "FGroupage <> Value" renvoi FALSE ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 procedure TStefThread.SetGroupage(Value: Boolean); begin FLogLock.Enter; try if FGroupage <> Value then FGroupage := Value; finally FLogLock.Leave; end; end;
Partager