diff options
author | Dan Gudmundsson <[email protected]> | 2018-12-07 13:21:04 +0100 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2018-12-07 13:21:04 +0100 |
commit | d65ccad5d6bc71fda09ce6bf3a220a536a9a6b62 (patch) | |
tree | 29a3bbea95f446feece021bca920b377904acef6 | |
parent | 95f796a108c74ae133cf891c678408d001eaee47 (diff) | |
parent | 1ec09d6d239194689a95a0f0111d751d9a57e407 (diff) | |
download | otp-d65ccad5d6bc71fda09ce6bf3a220a536a9a6b62.tar.gz otp-d65ccad5d6bc71fda09ce6bf3a220a536a9a6b62.tar.bz2 otp-d65ccad5d6bc71fda09ce6bf3a220a536a9a6b62.zip |
Merge branch 'dgud/wx/perf-imp' into maint
* dgud/wx/perf-imp:
Don't try to wake up wx thread when not necessary
-rw-r--r-- | lib/wx/c_src/wxe_helpers.cpp | 3 | ||||
-rw-r--r-- | lib/wx/c_src/wxe_helpers.h | 2 | ||||
-rw-r--r-- | lib/wx/c_src/wxe_impl.cpp | 4 |
3 files changed, 5 insertions, 4 deletions
diff --git a/lib/wx/c_src/wxe_helpers.cpp b/lib/wx/c_src/wxe_helpers.cpp index d1f607d2af..47955494f9 100644 --- a/lib/wx/c_src/wxe_helpers.cpp +++ b/lib/wx/c_src/wxe_helpers.cpp @@ -101,7 +101,7 @@ wxeCommand * wxeFifo::Peek(unsigned int *i) } -void wxeFifo::Add(int fc, char * cbuf,int buflen, wxe_data *sd) +int wxeFifo::Add(int fc, char * cbuf,int buflen, wxe_data *sd) { unsigned int pos; wxeCommand *curr; @@ -144,6 +144,7 @@ void wxeFifo::Add(int fc, char * cbuf,int buflen, wxe_data *sd) } else { // No-op only PING currently curr->buffer = NULL; } + return m_n; } void wxeFifo::Append(wxeCommand *orig) diff --git a/lib/wx/c_src/wxe_helpers.h b/lib/wx/c_src/wxe_helpers.h index 70ffccdc13..a6c00e5aca 100644 --- a/lib/wx/c_src/wxe_helpers.h +++ b/lib/wx/c_src/wxe_helpers.h @@ -63,7 +63,7 @@ class wxeFifo { wxeFifo(unsigned int size); virtual ~wxeFifo(); - void Add(int fc, char * cbuf,int buflen, wxe_data *); + int Add(int fc, char * cbuf,int buflen, wxe_data *); void Append(wxeCommand *Other); wxeCommand * Get(); 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(); } } |