|
@@ -83,6 +83,8 @@
|
|
|
|
|
|
|
|
static pthread_mutex_t timer_mutex = PTHREAD_MUTEX_INITIALIZER;
|
|
static pthread_mutex_t timer_mutex = PTHREAD_MUTEX_INITIALIZER;
|
|
|
|
|
|
|
|
|
|
+static pthread_cond_t timer_mutex_cond = PTHREAD_COND_INITIALIZER;
|
|
|
|
|
+
|
|
|
static pthread_t expiry_thread;
|
|
static pthread_t expiry_thread;
|
|
|
|
|
|
|
|
static pthread_attr_t thread_attr;
|
|
static pthread_attr_t thread_attr;
|
|
@@ -116,6 +118,8 @@ static void *prioritized_timer_thread (void *data)
|
|
|
}
|
|
}
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
|
|
+ pthread_mutex_lock (&timer_mutex);
|
|
|
|
|
+ pthread_cond_signal (&timer_mutex_cond);
|
|
|
pthread_mutex_unlock (&timer_mutex);
|
|
pthread_mutex_unlock (&timer_mutex);
|
|
|
for (;;) {
|
|
for (;;) {
|
|
|
timer_serialize_lock_fn ();
|
|
timer_serialize_lock_fn ();
|
|
@@ -170,6 +174,12 @@ int corosync_timer_init (
|
|
|
res = pthread_create (&expiry_thread, &thread_attr,
|
|
res = pthread_create (&expiry_thread, &thread_attr,
|
|
|
prioritized_timer_thread, NULL);
|
|
prioritized_timer_thread, NULL);
|
|
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
|
+ * Wait for thread to really exec
|
|
|
|
|
+ */
|
|
|
|
|
+ pthread_cond_wait (&timer_mutex_cond, &timer_mutex);
|
|
|
|
|
+ pthread_mutex_unlock (&timer_mutex);
|
|
|
|
|
+
|
|
|
return (res);
|
|
return (res);
|
|
|
}
|
|
}
|
|
|
|
|
|