Unverified Commit c0813291 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!4764 binder: signal epoll threads of self-work

parents e835dbfb e01b2912
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -836,6 +836,16 @@ binder_enqueue_thread_work_ilocked(struct binder_thread *thread,
{
	WARN_ON(!list_empty(&thread->waiting_thread_node));
	binder_enqueue_work_ilocked(work, &thread->todo);

	/* (e)poll-based threads require an explicit wakeup signal when
	 * queuing their own work; they rely on these events to consume
	 * messages without I/O block. Without it, threads risk waiting
	 * indefinitely without handling the work.
	 */
	if (thread->looper & BINDER_LOOPER_STATE_POLL &&
	    thread->pid == current->pid && !thread->process_todo)
		wake_up_interruptible_sync(&thread->wait);

	thread->process_todo = true;
}