aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/c_src/wxe_impl.cpp
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2018-12-06 21:50:46 +0100
committerDan Gudmundsson <[email protected]>2018-12-06 21:50:46 +0100
commit1ec09d6d239194689a95a0f0111d751d9a57e407 (patch)
tree29a3bbea95f446feece021bca920b377904acef6 /lib/wx/c_src/wxe_impl.cpp
parent73e4f5f21bbf492ab61c01dee48fa09fd7309a50 (diff)
downloadotp-1ec09d6d239194689a95a0f0111d751d9a57e407.tar.gz
otp-1ec09d6d239194689a95a0f0111d751d9a57e407.tar.bz2
otp-1ec09d6d239194689a95a0f0111d751d9a57e407.zip
Don't try to wake up wx thread when not necessary
That kills performance on at least windows when a the load goes up and a lot of commands is sent to the driver.
Diffstat (limited to 'lib/wx/c_src/wxe_impl.cpp')
-rw-r--r--lib/wx/c_src/wxe_impl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/wx/c_src/wxe_impl.cpp b/lib/wx/c_src/wxe_impl.cpp
index f856099ffa..bd22502d00 100644
--- a/lib/wx/c_src/wxe_impl.cpp
+++ b/lib/wx/c_src/wxe_impl.cpp
@@ -70,7 +70,7 @@ void push_command(int op,char * buf,int len, wxe_data *sd)
/* fprintf(stderr, "Op %d %d [%ld] %d\r\n", op, (int) driver_caller(sd->port_handle),
wxe_batch->size(), wxe_batch_caller),fflush(stderr); */
erl_drv_mutex_lock(wxe_batch_locker_m);
- wxe_queue->Add(op, buf, len, sd);
+ int n = wxe_queue->Add(op, buf, len, sd);
if(wxe_needs_signal) {
// wx-thread is waiting on batch end in cond_wait
@@ -79,7 +79,7 @@ void push_command(int op,char * buf,int len, wxe_data *sd)
} else {
// wx-thread is waiting gui-events
erl_drv_mutex_unlock(wxe_batch_locker_m);
- wxWakeUpIdle();
+ if(n < 2) wxWakeUpIdle();
}
}