Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
53b20b7a
Commit
53b20b7a
authored
Jul 07, 2019
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Work around sigpending() but on Cygwin.
parent
9cc537c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
async-unix.c++
c++/src/kj/async-unix.c++
+15
-0
No files found.
c++/src/kj/async-unix.c++
View file @
53b20b7a
...
...
@@ -938,9 +938,24 @@ bool UnixEventPort::poll() {
gotSignal
(
capture
.
siginfo
);
}
}
else
{
#if __CYGWIN__
// Cygwin's sigpending() incorrectly reports signals pending for any thread, not just our
// own thread. As a work-around, instead of using sigsuspend() (which would block forever
// if the signal is not pending on *this* thread), we un-mask the signals and immediately
// mask them again. If any signals are pending, they *should* be delivered before the first
// sigprocmask() returns, and the handler will then longjmp() to the block above. If it
// turns out no signal is pending, we'll block the signals again and break out of the
// loop.
//
// Bug reported here: https://cygwin.com/ml/cygwin/2019-07/msg00051.html
sigprocmask
(
SIG_SETMASK
,
&
waitMask
,
nullptr
);
sigprocmask
(
SIG_SETMASK
,
&
capture
.
originalMask
,
nullptr
);
break
;
#else
sigsuspend
(
&
waitMask
);
KJ_FAIL_ASSERT
(
"sigsuspend() shouldn't return because the signal handler should "
"have siglongjmp()ed."
);
#endif
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment