Browse Source

[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 6 years ago
parent
commit
8c65f67a65
1 changed files with 1 additions and 0 deletions
  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;
         if (wakeup) {
             debug("resuming thread %u\n", thread->tid);
+            thread_wakeup(thread);
             DkThreadResume(thread->pal_handle);
         }
     } else {