Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Restart Function (Read 2652 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Restart Function

I got a question about the restart function.
How is it managed, that foobar can restart without a helper exe which will be started and wait till the old foobar process is terminated and then start the new foobar process and close itself?

Any dev any idea?

Restart Function

Reply #1
My guess is that the core performs a regular shutdown (run component finalizer code, close UI, save settings and database, ...) and then releases the mutex is has been holding. At that point, the core can simply create a new foobar2000 process and exit. Perhaps there's some additional synchonization done between the old and the new instance, but that's only a minor issue.

Things get a little more complicated, if you are trying to restart foobar2000 using a component and if you want to do some work between shutting down the old instance and restarting the new one. foo_beammeup uses rundll32.exe to launch itself as a new process to accomplish that.

 

Restart Function

Reply #2
Hm... I had a look at the sourcecode of beammeup, but for my programing skills, things like process synchronisation or semaphore are too heavy.

Your idea restart just before mutex is killed sounds good.

But, is any core developer here, who can tell me the exact behaviour?