Skip to content

Commit 4d53218

Browse files
committed
#267 Improve documentation
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent f7a9746 commit 4d53218

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/scancode/interrupt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ def time_and_ram_interruptible(func, *args, **kwargs):
123123
timeout = kwargs.pop('timeout', MAX_TIMEOUT)
124124
max_memory = kwargs.pop('max_memory', MAX_MEMORY)
125125

126-
# we use a pool of three threads:
126+
# We use a pool of three threads that will race to finish against each other:
127127
# - one will run the func
128-
# - one will sleep until timeout
129-
# - one will run a loop to check for memory usage
128+
# - one will sleep until a timeout and return
129+
# - one will run a loop to check for memory usage and return when it exceedd max_memory
130130
# The first thread that completes will return a result and stop the pool. e.g if
131131
# the func completes within timeout and does not exceed RAM, it will return first
132132
# otherwise it will be killed and some error will be returned instead

0 commit comments

Comments
 (0)