Skip to content

Commit

Permalink
Patch up race condition exposed in #478
Browse files Browse the repository at this point in the history
  • Loading branch information
Xyene committed Sep 17, 2019
1 parent 4cb878f commit c267b56
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dmoj/judge.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ def process_submission(self, type, target, id, *args, **kwargs):
self.current_submission_thread.daemon = True
self.current_submission_thread.start()

if is_blocking:
# Submission may have been killed already, but block if it hasn't been.
if is_blocking and self.current_submission_thread is not None:
self.current_submission_thread.join()

def _custom_invocation(self, language, source, memory_limit, time_limit, input_data):
Expand Down

0 comments on commit c267b56

Please sign in to comment.