Skip to content

Is destoring dbus object thread safe? #330

Closed Answered by sangelovic
Snarpix asked this question in Q&A
Discussion options

You must be logged in to vote

Hello, no, it's not correct. The Object instance will not be destroyed as long as there are calls being served by that object. This is guaranteed by internal thread safety design of sdbus-c++. Thread safety chapter discusses this to some detail. It says it's completely safe to destroy Object and Proxy instances at any time. This of course counts with the fact that there may be operations pending on those instances at that very same time -- these operations are finished first and then the object is destroyed.

So in your case, the thread destructing the object would wait for at most 300 seconds until the event loop thread serving the object finishes serving the call.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Snarpix
Comment options

@Snarpix
Comment options

@sangelovic
Comment options

Answer selected by Snarpix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #329 on June 21, 2023 11:36.