Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
26ea164c
Commit
26ea164c
authored
Feb 17, 2014
by
Daniel Colascione
Browse files
Improve dbus performance on synchronous calls
parent
2830e9b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
5 deletions
+20
-5
lisp/ChangeLog
lisp/ChangeLog
+6
-0
lisp/net/dbus.el
lisp/net/dbus.el
+14
-5
No files found.
lisp/ChangeLog
View file @
26ea164c
2014-02-17 Daniel Colascione <dancol@dancol.org>
* net/dbus.el (dbus-call-method): Work around bug#16775 by having
dbus-call-method check for completion using a busy-wait loop with
gradual backoff.
2013-10-02 Michael Albinus <michael.albinus@gmx.de>
Sync with Tramp 2.2.9.
...
...
lisp/net/dbus.el
View file @
26ea164c
...
...
@@ -260,6 +260,7 @@ object is returned instead of a list containing this single Lisp object.
(
signal
'wrong-type-argument
(
list
'stringp
method
)))
(
let
((
timeout
(
plist-get
args
:timeout
))
(
check-interval
0.001
)
(
key
(
apply
'dbus-message-internal
dbus-message-type-method-call
...
...
@@ -270,13 +271,21 @@ object is returned instead of a list containing this single Lisp object.
;; default 25". Events which are not from D-Bus must be restored.
;; `read-event' performs a redisplay. This must be suppressed; it
;; hurts when reading D-Bus events asynchronously.
;; Work around bug#16775 by busy-waiting with gradual backoff for
;; dbus calls to complete. A better aproach would involve either
;; adding arbitrary wait condition support to read-event or
;; restructuring dbus as a kind of process object. Poll at most
;; about once per second for completion.
(
with-timeout
((
if
timeout
(
/
timeout
1000.0
)
25
))
(
while
(
eq
(
gethash
key
dbus-return-values-table
:ignore
)
:ignore
)
(
let
((
event
(
let
((
inhibit-redisplay
t
)
unread-command-events
)
(
read-event
nil
nil
0.1
))))
(
when
(
and
event
(
not
(
ignore-errors
(
dbus-check-event
event
))))
(
setq
unread-command-events
(
append
unread-command-events
(
list
event
)))))))
(
let
((
event
(
let
((
inhibit-redisplay
t
)
unread-command-events
)
(
read-event
nil
nil
check-interval
))))
(
when
event
(
push
event
unread-command-events
))
(
when
(
<
check-interval
1
)
(
setf
check-interval
(
*
check-interval
1.05
))))))
;; Cleanup `dbus-return-values-table'. Return the result.
(
prog1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment