瀏覽代碼

[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 年之前
父節點
當前提交
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;
         if (wakeup) {
             debug("resuming thread %u\n", thread->tid);
+            thread_wakeup(thread);
             DkThreadResume(thread->pal_handle);
         }
     } else {