mirror of
https://github.com/ejwa/gitinspector.git
synced 2024-11-16 00:28:25 +01:00
Added a constant to the blame module for the number of threads.
This commit is contained in:
parent
35b4194b40
commit
96e87ae457
1 changed files with 4 additions and 2 deletions
6
blame.py
6
blame.py
|
@ -28,11 +28,13 @@ import sys
|
|||
import terminal
|
||||
import threading
|
||||
|
||||
NUM_THREADS = multiprocessing.cpu_count()
|
||||
|
||||
class BlameEntry:
|
||||
rows = 0
|
||||
comments = 0
|
||||
|
||||
__thread_lock__ = threading.BoundedSemaphore(multiprocessing.cpu_count())
|
||||
__thread_lock__ = threading.BoundedSemaphore(NUM_THREADS)
|
||||
__blame_lock__ = threading.Lock()
|
||||
|
||||
class BlameThread(threading.Thread):
|
||||
|
@ -90,7 +92,7 @@ class Blame:
|
|||
Blame.output_progress(i, len(lines))
|
||||
|
||||
# Make sure all threads have completed.
|
||||
for i in range(0, multiprocessing.cpu_count()):
|
||||
for i in range(0, NUM_THREADS):
|
||||
__thread_lock__.acquire()
|
||||
|
||||
@staticmethod
|
||||
|
|
Loading…
Reference in a new issue