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 250fa97
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 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
5 changes: 3 additions & 2 deletions Lib/using.py
Original file line number Diff line number Diff line change
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)


3 changes: 3 additions & 0 deletions Objects/regions.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ static void _PyErr_Region(PyObject *src, PyObject *tgt, const char *msg);
* Global status for performing the region check.
*/
bool invariant_do_region_check = false;
/**
* TODO: revisit the definition of this builting function
*/
int Py_is_invariant_enabled(void) {
return invariant_do_region_check;
}
Expand Down

0 comments on commit 250fa97

Please sign in to comment.