Просмотр исходного кода

[LibOS] signal: wakeup thread on append_signal

There are race condition on thread_sleep() and DkThreadResume().
To avoid it, wake up the thread.
test program is can be found at
https://github.com/oscarlab/graphene/pull/452.
NOTE: there are still other race conditions. this patch
only address one of them.

Signed-off-by: Isaku Yamahata <isaku.yamahata@gmail.com>
Isaku Yamahata 7 лет назад
Родитель
Сommit
8c65f67a65
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      LibOS/shim/src/bookkeep/shim_signal.c

+ 1 - 0
LibOS/shim/src/bookkeep/shim_signal.c

@@ -662,6 +662,7 @@ void append_signal (struct shim_thread * thread, int sig, siginfo_t * info,
         *signal_log = signal;
         *signal_log = signal;
         if (wakeup) {
         if (wakeup) {
             debug("resuming thread %u\n", thread->tid);
             debug("resuming thread %u\n", thread->tid);
+            thread_wakeup(thread);
             DkThreadResume(thread->pal_handle);
             DkThreadResume(thread->pal_handle);
         }
         }
     } else {
     } else {