Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Week07/threaded_eren_malkoc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import threading

def threaded(n):
def decorator(func):
def wrapper(*args, **kwargs):
threads = []
for _ in range(n):
thread = threading.Thread(target=func, args=args, kwargs=kwargs)
threads.append(thread)
thread.start()
for thread in threads:
thread.join()
return wrapper
return decorator
Loading