diff --git a/Duplicati/Library/Main/Operation/Restore/FileProcessor.cs b/Duplicati/Library/Main/Operation/Restore/FileProcessor.cs
index 72bcbc60f..f1177e31b 100644
--- a/Duplicati/Library/Main/Operation/Restore/FileProcessor.cs
+++ b/Duplicati/Library/Main/Operation/Restore/FileProcessor.cs
@@ -56,13 +56,9 @@ namespace Duplicati.Library.Main.Operation.Restore
public static object file_processor_continue_lock = new object();
public static TaskCompletionSource file_processor_continue = new();
///
- /// Lock for the file processor ID.
- ///
- public static object id_lock = new();
- ///
/// The current file processor ID. Used for debugging.
///
- public static int id = 0;
+ private static int processor_id = 0;
///
/// Runs the file processor process that restores the files that need to be restored.
@@ -102,11 +98,7 @@ namespace Duplicati.Library.Main.Operation.Restore
// Indicates whether this FileProcessor is still restoring files
var decremented = false;
// ID for this file processor, used for debugging.
- int my_id = -1;
- lock (id_lock)
- {
- my_id = id++;
- }
+ var my_id = Interlocked.Increment(ref processor_id);
try
{