modified to check pending call completion 77/69377/1
authorsanghyeok.oh <sanghyeok.oh@samsung.com>
Fri, 13 May 2016 02:40:16 +0000 (11:40 +0900)
committersanghyeok.oh <sanghyeok.oh@samsung.com>
Fri, 13 May 2016 02:40:35 +0000 (11:40 +0900)
for blocking call(pending_call_block)
after acuire io path, check pending call completion before iteration(poll)
and wake up by any reason, but there are no reply, timeout is not reached, then retry polling,
next time, if it acquire io path, then just enter iteration(poll) without completion check,

for multi-threaded blocking call,
1. if first thread waiting io path(not 1st iteration),
2. second thread is polling,
3. reply message is arrived and this wake up seconds thread's polling,
4. first thread just enter polling until timeout
5. if there are no incoming event, then dead-lock until timeout.

Change-Id: Ifcfe53b7610996d1892519f4a69cf435aa395968
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
dbus/dbus-connection.c

index 5531fbb..4390afa 100644 (file)
@@ -2555,7 +2555,7 @@ _dbus_connection_block_pending_call (DBusPendingCall *pending)
         {          
           /* block again, we don't have the reply buffered yet. */
           _dbus_connection_do_iteration_unlocked (connection,
-                                                  NULL,
+                                                  pending,
                                                   DBUS_ITERATION_DO_READING |
                                                   DBUS_ITERATION_BLOCK,
                                                   timeout_milliseconds - elapsed_milliseconds);