We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6f94a62 commit cde3abcCopy full SHA for cde3abc
Week07/threaded_rukiye_ilhan.py
@@ -1,14 +1,17 @@
1
import threading
2
3
-def threaded(func):
4
- def wrapper(n, *args, **kwargs):
+def threaded(n):
+ """İlk fonksiyon - thread sayısını parametre olarak alır"""
5
+ def wrapper(func):
6
+ """İkinci fonksiyon - thread'leri oluşturur ve yönetir"""
7
threads = []
8
+ #istenen n sayıdaki tjread oluşturldu
9
for _ in range(n):
- t = threading.Thread(target=func, args=args, kwargs=kwargs)
10
+ t = threading.Thread(target=func)
11
threads.append(t)
12
t.start()
- for t in threads:
- t.join()
13
+ # Bütün thread'lerin bitmesini bekle
14
+ for thread in threads:
15
+ thread.join()
16
+ return func # Orijinal fonksiyonu döndür
17
return wrapper
-
0 commit comments