How to prevent the creation of new threads? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
afe
Posts: 615
Joined: 06 Dec 2018, 04:36

How to prevent the creation of new threads?

12 Sep 2019, 07:29

Hello,

If a thread needs to create a temporary file, delete the file when it is finished. How to prevent a new same thread from starting again when the thread is not finished? This is not desirable if the second thread is not prevented from modifying the temporary file again.

The thread is launched from the context menu. Is there any other way besides temporarily disabling this context menu option? For example, a window showing the task in progress.

In other words, when there is a task busy, a window prompt is displayed, and after the task is finished, the window is closed.

Thanks.
afe
Posts: 615
Joined: 06 Dec 2018, 04:36

Re: How to prevent the creation of new threads?

12 Sep 2019, 09:33

Hi, when I put it in a label of the context menu and right-clicked the menu twice, all the controls in the script lost their response. Where is it wrong?

Code: Select all

Gui, Add, ListView,, TEST
Menu, ContextMenu, Add, Open, Open
Gui, Show
return

GuiContextMenu:
   Menu, ContextMenu, Show
return

Open:
   Critical
   Sleep, 3000
   Msgbox OK
return

Last edited by afe on 12 Sep 2019, 11:19, edited 1 time in total.
just me
Posts: 9456
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: How to prevent the creation of new threads?

12 Sep 2019, 11:06

Where is it wrong?
Where you prevent the creation of new threads!
afe
Posts: 615
Joined: 06 Dec 2018, 04:36

Re: How to prevent the creation of new threads?

12 Sep 2019, 11:28

Click on the Open menu once and multiple right click again. The program will not display OK on time, and the CPU consumption will increase sharply. Why?
Rohwedder
Posts: 7644
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: How to prevent the creation of new threads?  Topic is solved

12 Sep 2019, 12:10

Hallo,
replace Critical by Thread, Priority, 1
afe
Posts: 615
Joined: 06 Dec 2018, 04:36

Re: How to prevent the creation of new threads?

15 Sep 2019, 06:14

Thread, Priority, 1 work fine. Thank you!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Chunjee, Google [Bot], Joey5, mebelantikjaya and 322 guests