Skip to content

Commit

Permalink
Added comment suggested by @mjp41 and fixed trailing space bug
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasWrigstad committed Jan 27, 2025
1 parent 7ff6238 commit 4245516
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Lib/test/test_using.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def _():
result = c.get().value.value
if result != 200:
self.fail()

def test_thread_creation(self):
from threading import PyronaThread as T

Expand Down
7 changes: 4 additions & 3 deletions Lib/using.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from contextlib import contextmanager
efrom contextlib import contextmanager

# This library defines a decorator "@using" that uses blocking semantics.
# A function decorated by a @using will be called as a result of its
Expand Down Expand Up @@ -46,6 +46,9 @@ def decorator(func):
return func()
return decorator

# TODO: this creates a normal Python thread and ensures that all its
# arguments are moved to the new thread. Eventually we should revisit
# this behaviour as we go multiple interpreters / multicore.
def PyronaThread(group=None, target=None, name=None,
args=(), kwargs=None, *, daemon=None):
# Only check when a program uses pyrona
Expand Down Expand Up @@ -96,5 +99,3 @@ def ok_move(o):
if not (ok_share(v) or (ok_move(v) and rc(kwargs) == 3)):
raise RuntimeError("Thread was passed an object which was neither immutable, a cown, or a unique region")
return Thread(group, target, name, kwargs, daemon)


0 comments on commit 4245516

Please sign in to comment.