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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...