Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
alexbiehl-gc
GHC
Commits
37d4af06
Commit
37d4af06
authored
25 years ago
by
Simon Marlow
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 2000-03-23 12:02:38 by simonmar]
Don't wake up threads if the select() was interrupted by a signal.
parent
b14d8a68
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/rts/Select.c
+8
-4
8 additions, 4 deletions
ghc/rts/Select.c
with
8 additions
and
4 deletions
ghc/rts/Select.c
+
8
−
4
View file @
37d4af06
/* -----------------------------------------------------------------------------
* $Id: Select.c,v 1.1
0
2000/03/2
0 09:42:50 andy
Exp $
* $Id: Select.c,v 1.1
1
2000/03/2
3 12:02:38 simonmar
Exp $
*
* (c) The GHC Team 1995-1999
*
...
...
@@ -52,6 +52,7 @@ awaitEvent(rtsBool wait)
int
numFound
;
nat
min
,
delta
;
int
maxfd
=
-
1
;
rtsBool
select_succeeded
=
rtsTrue
;
struct
timeval
tv
;
#ifndef linux_TARGET_OS
...
...
@@ -165,6 +166,8 @@ awaitEvent(rtsBool wait)
if
(
signals_pending
())
{
RELEASE_LOCK
(
&
sched_mutex
);
start_signal_handlers
();
/* Don't wake up any other threads that were waiting on I/O */
select_succeeded
=
rtsFalse
;
break
;
}
...
...
@@ -173,6 +176,7 @@ awaitEvent(rtsBool wait)
*/
if
(
run_queue_hd
!=
END_TSO_QUEUE
)
{
RELEASE_LOCK
(
&
sched_mutex
);
select_succeeded
=
rtsFalse
;
break
;
}
...
...
@@ -209,16 +213,15 @@ awaitEvent(rtsBool wait)
next
=
tso
->
link
;
switch
(
tso
->
why_blocked
)
{
case
BlockedOnRead
:
ready
=
FD_ISSET
(
tso
->
block_info
.
fd
,
&
rfd
);
ready
=
select_succeeded
&&
FD_ISSET
(
tso
->
block_info
.
fd
,
&
rfd
);
break
;
case
BlockedOnWrite
:
ready
=
FD_ISSET
(
tso
->
block_info
.
fd
,
&
wfd
);
ready
=
select_succeeded
&&
FD_ISSET
(
tso
->
block_info
.
fd
,
&
wfd
);
break
;
case
BlockedOnDelay
:
{
int
candidate
;
/* signed int is intentional */
#if defined(HAVE_SETITIMER)
if
(
tso
->
block_info
.
delay
>
delta
)
{
tso
->
block_info
.
delay
-=
delta
;
...
...
@@ -228,6 +231,7 @@ awaitEvent(rtsBool wait)
ready
=
1
;
}
#else
int
candidate
;
/* signed int is intentional */
candidate
=
tso
->
block_info
.
target
-
getourtimeofday
();
if
(
candidate
<
0
)
{
candidate
=
0
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment