diff options
author | Dan Gudmundsson <[email protected]> | 2017-05-24 15:28:01 +0200 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2017-05-24 15:28:01 +0200 |
commit | 3b4b6cdeaec93f498d8586bffe9061a721d4088d (patch) | |
tree | c920c55466cfb0e858e846b2c7078e985ca0905c | |
parent | f2805093b6e4777739398ad7fae0499caace7daa (diff) | |
download | otp-3b4b6cdeaec93f498d8586bffe9061a721d4088d.tar.gz otp-3b4b6cdeaec93f498d8586bffe9061a721d4088d.tar.bz2 otp-3b4b6cdeaec93f498d8586bffe9061a721d4088d.zip |
wx: Tune when to break command loop in driver
Exit command loop less often too avoid expensive event checking
while in batch mode.
-rw-r--r-- | lib/wx/c_src/wxe_impl.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/wx/c_src/wxe_impl.cpp b/lib/wx/c_src/wxe_impl.cpp index 7817e7fa8a..1510866f09 100644 --- a/lib/wx/c_src/wxe_impl.cpp +++ b/lib/wx/c_src/wxe_impl.cpp @@ -267,7 +267,7 @@ int WxeApp::dispatch_cmds() return more; } -#define BREAK_BATCH 200 +#define BREAK_BATCH 10000 int WxeApp::dispatch(wxeFifo * batch) { @@ -284,7 +284,7 @@ int WxeApp::dispatch(wxeFifo * batch) if(blevel>0) { blevel--; if(blevel==0) - wait += BREAK_BATCH*100; + wait += BREAK_BATCH/4; } break; case WXE_BATCH_BEGIN: @@ -317,7 +317,7 @@ int WxeApp::dispatch(wxeFifo * batch) erl_drv_mutex_lock(wxe_batch_locker_m); batch->Cleanup(); } - if(blevel <= 0 || wait > BREAK_BATCH) { + if(blevel <= 0 || wait >= BREAK_BATCH) { erl_drv_mutex_unlock(wxe_batch_locker_m); if(blevel > 0) { return 1; // We are still in a batch but we can let wx check for events |