RosettaCodeData/Task/Determine-if-only-one-instance-is-running/Mathematica/determine-if-only-one-instance-is-running.math
2023-07-01 13:44:08 -04:00

5 lines
158 B
Text

$Epilog := Print["Another instance is running "];
If[Attributes[Global`Mutex] == {Protected},
Exit[],
Global`Mutex[x_] := Locked; Protect[Global`Mutex];
]