Client example: rework mutexes 10/276610/2
authorMichal Bloch <m.bloch@samsung.com>
Tue, 21 Jun 2022 18:01:42 +0000 (20:01 +0200)
committerMichal Bloch <m.bloch@samsung.com>
Wed, 22 Jun 2022 13:05:37 +0000 (15:05 +0200)
commit287acc8cfb4d6be7c7e7a7dd15a850f622ecca4a
tree275a1009211f97f943ff89caa4d926f8dc66fd2b
parenta06cb6885908f331d51f28a9552ccfdeb6addd29
Client example: rework mutexes

 * add a lot of commentary, including to the newly added
   example of passing values to the callback.

 * use a conditional variable instead of a single mutex.
   This is because glib mutexes (and their underlying
   default POSIX mutexes) have undefined behaviour when
   trying to lock an already owned mutex from the owning
   thread. As a side effect, this gets rid of the trylock
   mechanism which (even though it worked) was confusing.

 * fix the mutex being left locked on subsession call error.

Change-Id: I1afa973bcae57ff8c7434d2365d51893ff7696d0
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
clientExample/app/main.cpp