Jump to content

Protect a portion of code in a session : Tcriticalsection or other ?


delagoutte

Recommended Posts

Hello,

i have a grid with a onselectionchange

in this event i have a code like this

procedure TMainForm.MygridSelectionChange(Sender: TObject);
begin
  MyFrame.LoadData;
end;

I would like to know what it is the best method to be certain that I do not enter many times in parallel in this portion of code Loaddata.

What is the good method for be sure TCriticalsession unisession.locksession , ... other ?

If i use TCriticalSection, i think that i have this portion of code that will be locked/protected for all session but i would protect it only for the usersession.

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...