Skip to content

Commit 118f940

Browse files
committed
Cleanup
1 parent 482dd4e commit 118f940

File tree

3 files changed

+31
-7
lines changed

3 files changed

+31
-7
lines changed

Jamfile

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,24 @@ install_location ?=
7474
/boot/system/non-packaged/lib/python$(python_version)/site-packages ;
7575

7676
# Where to search for .cpp files
77-
SEARCH_SOURCE += bindings/interface bindings/app bindings/support bindings/storage bindings/kernel bindings/translation bindings/add-ons/screen_saver bindings/add-ons/registrar bindings/add-ons/graphics bindings/add-ons/input_server bindings/add-ons/mail_daemon bindings/add-ons/network_settings bindings/drivers bindings/device bindings/mail bindings/locale bindings/media ;
77+
SEARCH_SOURCE +=
78+
bindings/interface
79+
bindings/app
80+
bindings/support
81+
bindings/storage
82+
bindings/kernel
83+
bindings/translation
84+
bindings/add-ons/screen_saver
85+
bindings/add-ons/registrar
86+
bindings/add-ons/graphics
87+
bindings/add-ons/input_server
88+
bindings/add-ons/mail_daemon
89+
bindings/add-ons/network_settings
90+
bindings/drivers
91+
bindings/device
92+
bindings/mail
93+
bindings/locale
94+
bindings/media ;
7895

7996
# Where to look for header files
8097
SubDirHdrs headers ;

bindings/app/Application.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ class PyBApplication : public BApplication{
5050
PYBIND11_OVERLOAD(status_t, BApplication, Archive, data, deep);
5151
}
5252
thread_id Run() override {
53+
// There is no need to release the GIL here like RunWrapper. Here,
54+
// the GIL starts off unacquired, whereas in RunWrapper, the GIL
55+
// starts off acquired. Here, only if pybind sees that there
56+
// is a Python function overriding Run that needs to be run will
57+
// it acquire the GIL. Otherwise, it stays unacquired.
5358
PYBIND11_OVERLOAD(thread_id, BApplication, Run);
5459
}
5560
void Quit() override {

bindings/app/Looper.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,15 @@ class PyBLooper : public BLooper{
5555
PYBIND11_OVERLOAD(thread_id, BLooper, Run);
5656
}
5757
void Quit() override {
58-
py::gil_scoped_acquire acquire;
58+
{
59+
py::gil_scoped_acquire acquire;
5960

60-
// Not sure if it's actually necessary to release the reference
61-
// to ourselves, since we will delete ourselves anyway.
62-
// FIXME: What if the Python overload never actually calls
63-
// BLooper::Quit?
64-
do_not_delete.release();
61+
// Not sure if it's actually necessary to release the reference
62+
// to ourselves, since we will delete ourselves anyway.
63+
// FIXME: What if the Python overload never actually calls
64+
// BLooper::Quit?
65+
do_not_delete.release();
66+
}
6567

6668
PYBIND11_OVERLOAD(void, BLooper, Quit);
6769
}

0 commit comments

Comments
 (0)