Commit 00f8c8c6 authored by norvell's avatar norvell
Browse files

Remove lock -- file names are unique and lock should not be needed

parent ace60387
Loading
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -42,9 +42,6 @@ import textwrap
from pathlib import Path
from subprocess import STDOUT, CalledProcessError, TimeoutExpired, run
from typing import Optional, Union
import threading

lock = threading.Lock() # Lock for fer bitstreams

logger = logging.getLogger(__name__)
USE_LOGGER_FOR_DBG = False  # current tests do not make use of the logger feature
@@ -487,10 +484,6 @@ class DecoderFrontend:
                str(input_bitstream_path) + eid_output_suffix,
            ]

            # If the same bitstream is combined with the same error patterns multiple times, 
            # the following section may create a race condition. Hence, it is guarded by a 
            # lock and the file is only created if it does not exist already.
            lock.acquire()
            try:
                if not os.path.exists(str(input_bitstream_path) + eid_output_suffix):
                    result = run(eid_command, check=True)
@@ -498,7 +491,6 @@ class DecoderFrontend:
                print(result.stderr)
                print(result.stdout)
                pytest.fail(f"eid-xor operation failed!")
            lock.release()

            input_bitstream_path += eid_output_suffix