Questions tagged [process-exit]
9 questions
9
votes
1 answer
Is linux release the spinlock/semaphore when it kill a process?
If a process holds some spinlocks or semaphores, and exit accidently(e.g., killed by linux), would linux release these locks correctly?
If linux doesn't do this work, why?

silverbullettt
- 846
- 1
- 10
- 13
7
votes
2 answers
When will AppDomain.ProcessExit not get called?
Enabling line //1 below will make the program crash without "proc exit" being printed,
but in case of line //2, "proc exit" will be printed. "unhandled" btw gets printed in both cases.
Why the difference, and what are the rules in general? Obviously…

Evgeniy Berezovsky
- 18,571
- 13
- 82
- 156
5
votes
1 answer
How to fail a gitlab-ci job from node.js
On a giltab ci job I am running a node.js script where I evaluate some conditions, and where I might want to force the job to fail.
The script is written in es6 and is ran with yarn and babel-node yarn babel-node ./script-in-es6.js.
When the…

Marcio Oliveira
- 791
- 1
- 5
- 18
4
votes
1 answer
How to Exit a Process (.exec()) if the External Program hangs
Let me explain my software. What my software simply does is that it creates 10 threads and assigns a number of tasks to each thread. Each thread then creates a Runtime Process that will start a cmd batch file which in turn will start a program that…

mohammed lalalala
- 43
- 1
- 4
2
votes
0 answers
EventsThreadsShutdown not always, ProcessExit always works, why
I need a general purpose (any C# app) way of catching the event of any type of C# application ending so I can write log data to a file at that time.
I discovered that Microsoft.Win32.SystemEvents.EventsThreadShutdown does not catch the shutdown…

user2684161
- 59
- 1
- 3
0
votes
1 answer
How can I access a non-static member in a static event handler?
I already know you can't normally do this but here's my situation:
I have a non-static List that gets added to during normal use, and then dumped to a database at an interval. I want to be able to use AppDomain.CurrentDomain.ProcessExit in order…

5SK5
- 159
- 1
- 1
- 15
0
votes
9 answers
why we use any value in exit function in loop in c language
In C/C++ language loop statements we use exit(0), or exit(1) or other values. What is needed of that value, what is the role of that value in a loop when we exit the loop, and what is the meaning of 1 and 0 in exit()?

vijay singh
- 11
- 1
- 1
0
votes
1 answer
Process often exiting prematurely
I have this small piece of code (easy to try):
class Program
{
static void Main(string[] args)
{
List paths = new List() { "1.docx", "2.docx", "3.docx", "4.docx" };
foreach (string path in paths)
{
…

Andrius Naruševičius
- 8,348
- 7
- 49
- 78
0
votes
1 answer
DeleteFile of an EXE immediately after Process.WaitForExit fails
I do the following:
Copy an executable to C:\temp\x.exe
Start the executable with System.Diagnostics.Process.Start and then wait for the process to exit, synchronously, by calling WaitForExit on the Process object returned by Start.
Delete the…

Pierre Arnaud
- 10,212
- 11
- 77
- 108