<html><head></head><body>This does not seem to make much sense. <br><br>Either taking the mutex is not necessary and it should be removed. Or it is necessary, and the value is intrinsically no longer valid once the mutex is released, such that no inferences can be made from it.<br><br>So the patch looks wrong one way or the other.<br><br><div class="gmail_quote">Le 20 mars 2019 00:45:16 GMT+08:00, Thomas Guillem <thomas@gllm.fr> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail"><hr> src/clock/clock.c | 8 ++++++++<br> src/clock/clock.h | 5 +++++<br> 2 files changed, 13 insertions(+)<br><br>diff --git a/src/clock/clock.c b/src/clock/clock.c<br>index 15a6cf68e4..bc8eff55b7 100644<br>--- a/src/clock/clock.c<br>+++ b/src/clock/clock.c<br>@@ -551,6 +551,14 @@ void vlc_clock_main_SetMaster(vlc_clock_main_t *main_clock, vlc_clock_t *clock)<br> vlc_mutex_unlock(&main_clock->lock);<br> }<br> <br>+bool vlc_clock_IsMaster(vlc_clock_t *clock)<br>+{<br>+ vlc_clock_main_t *main_clock = clock->owner;<br>+ vlc_mutex_lock(&main_clock->lock);<br>+ bool is_master = main_clock->master == clock;<br>+ vlc_mutex_unlock(&main_clock->lock);<br>+ return is_master;<br>+}<br> <br> void vlc_clock_Delete(vlc_clock_t *clock)<br> {<br>diff --git a/src/clock/clock.h b/src/clock/clock.h<br>index 8f281523d8..c11a3d1234 100644<br>--- a/src/clock/clock.h<br>+++ b/src/clock/clock.h<br>@@ -93,6 +93,11 @@ vlc_clock_t *vlc_clock_CreateSlave(const vlc_clock_t *clock);<br> */<br> void vlc_clock_Delete(vlc_clock_t *clock);<br> <br>+/**<br>+ * This function returns true if the current clock is the master one<br>+ */<br>+bool vlc_clock_IsMaster(vlc_clock_t *clock);<br>+<br> /**<br> * This function will update the clock drift and returns the drift<br> */</pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>