RLock in documentation

This commit is contained in:
Casper da Costa-Luis 2017-10-15 19:19:04 +01:00
parent 2c9344754e
commit 42f213b405
No known key found for this signature in database
GPG Key ID: 986B408043AE090D
2 changed files with 4 additions and 4 deletions

View File

@ -519,7 +519,7 @@ you may specify ``position=n`` where ``n=0`` for the outermost bar,
from time import sleep
from tqdm import trange
from multiprocessing import Pool, freeze_support, Lock
from multiprocessing import Pool, freeze_support, RLock
L = list(range(9))
@ -534,7 +534,7 @@ you may specify ``position=n`` where ``n=0`` for the outermost bar,
freeze_support() # for Windows support
p = Pool(len(L),
# again, for Windows support
initializer=tqdm.set_lock, initargs=(Lock(),))
initializer=tqdm.set_lock, initargs=(RLock(),))
p.map(progresser, L)
print("\n" * (len(L) - 2))

View File

@ -1,7 +1,7 @@
from __future__ import print_function
from time import sleep
from tqdm import tqdm
from multiprocessing import Pool, freeze_support, Lock
from multiprocessing import Pool, freeze_support, RLock
L = list(range(9))
@ -19,7 +19,7 @@ if __name__ == '__main__':
freeze_support() # for Windows support
p = Pool(len(L),
initializer=tqdm.set_lock,
initargs=(Lock(),))
initargs=(RLock(),))
p.map(progresser, L)
print("\n" * (len(L) - 2))