@@ -423,7 +423,7 @@ static int coredump_wait(int exit_code, struct core_state *core_state)
if (core_waiters > 0) {
struct core_thread *ptr;
- wait_for_completion(&core_state->startup);
+ wait_for_completion_freezable(&core_state->startup);
/*
* Wait for all the threads to become inactive, so that
* all the thread context (extended register state, like
@@ -89,6 +89,7 @@ static inline void reinit_completion(struct completion *x)
}
extern void wait_for_completion(struct completion *);
+extern void wait_for_completion_freezable(struct completion *);
extern void wait_for_completion_io(struct completion *);
extern int wait_for_completion_interruptible(struct completion *x);
extern int wait_for_completion_killable(struct completion *x);
@@ -11,6 +11,7 @@
* Waiting for completion is a typically sync point, but not an exclusion point.
*/
+#include <linux/freezer.h>
#include <linux/sched.h>
#include <linux/completion.h>
@@ -123,6 +124,12 @@ void __sched wait_for_completion(struct completion *x)
}
EXPORT_SYMBOL(wait_for_completion);
+void __sched wait_for_completion_freezable(struct completion *x)
+{
+ __wait_for_common(x, freezable_schedule_timeout,
+ MAX_SCHEDULE_TIMEOUT, TASK_UNINTERRUPTIBLE);
+}
+
/**
* wait_for_completion_timeout: - waits for completion of a task (w/timeout)
* @x: holds the state of this particular completion