Skip to content

Commit

Permalink
Enable threadallow and remove patched code path
Browse files Browse the repository at this point in the history
  • Loading branch information
synvima committed Dec 6, 2024
1 parent 7f122fb commit 5270e4d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions Examples/test-suite/director_thread_lock.i
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ extern "C" {
%}

%director Foo;
%threadallow Foo::invoke_foo;
%threadallow Foo::invoke_bar;
%threadallow Foo::stop;

%inline {
static void MilliSecondSleep(int milliseconds) {
Expand Down
18 changes: 9 additions & 9 deletions Source/Modules/python.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3130,16 +3130,16 @@ class PYTHON:public Language {
/* Emit the function call */
if (director_method) {
Append(f->code, "try {\n");
}

if (allow_thread) {
String *preaction = NewString("");
thread_begin_allow(n, preaction);
Setattr(n, "wrap:preaction", preaction);
} else {
if (allow_thread) {
String *preaction = NewString("");
thread_begin_allow(n, preaction);
Setattr(n, "wrap:preaction", preaction);

String *postaction = NewString("");
thread_end_allow(n, postaction);
Setattr(n, "wrap:postaction", postaction);
String *postaction = NewString("");
thread_end_allow(n, postaction);
Setattr(n, "wrap:postaction", postaction);
}
}

Setattr(n, "wrap:name", wname);
Expand Down

0 comments on commit 5270e4d

Please sign in to comment.