Under some circumstances, this lock mechanism (which looks very fishy upon superficial inspection, a semaphore is certainly something different) appears to fail, leading to ugly race conditions during knossos dataset writing (line 1928):
while True:
try:
os.makedirs(folder_path+"block") # Semaphore --------
break
except:
if time.time() - \
os.stat(folder_path+"block").st_mtime > 5:
os.rmdir(folder_path+"block")
os.makedirs(folder_path+"block")
break
time.sleep(1)`
Under some circumstances, this lock mechanism (which looks very fishy upon superficial inspection, a semaphore is certainly something different) appears to fail, leading to ugly race conditions during knossos dataset writing (line 1928):