Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
224f25a6
Commit
224f25a6
authored
Jul 15, 2004
by
sof
Browse files
[project @ 2004-07-15 20:50:40 by sof]
oops, back out rev. 1.31
parent
b87accfa
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/rts/Select.c
View file @
224f25a6
/* -----------------------------------------------------------------------------
* $Id: Select.c,v 1.3
1
2004/07/15 20:
42
:4
5
sof Exp $
* $Id: Select.c,v 1.3
2
2004/07/15 20:
50
:4
0
sof Exp $
*
* (c) The GHC Team 1995-2002
*
...
...
@@ -35,10 +35,6 @@
#include <unistd.h>
#endif
#ifdef INTEGRITY
#include <sys/socket.h>
#endif
/* last timestamp */
nat
timestamp
=
0
;
...
...
@@ -170,19 +166,7 @@ awaitEvent(rtsBool wait)
#ifdef RTS_SUPPORTS_THREADS
if
(
!
workerWakeupInited
)
{
#if defined(INTEGRITY)
int
arg
;
int
rc
=
socketpair
(
AF_LOCAL
,
SOCK_STREAM
,
0
,
workerWakeupPipe
);
if
(
rc
==
-
1
)
{
printf
(
"failed to create socketpair: %d
\n
"
,
errno
);
}
arg
=
fcntl
(
workerWakeupPipe
[
0
],
F_GETFL
,
0
);
fcntl
(
workerWakeupPipe
[
0
],
F_SETFL
,
arg
|
O_NONBLOCK
);
arg
=
fcntl
(
workerWakeupPipe
[
1
],
F_GETFL
,
0
);
fcntl
(
workerWakeupPipe
[
1
],
F_SETFL
,
arg
|
O_NONBLOCK
);
#else
pipe
(
workerWakeupPipe
);
#endif
workerWakeupInited
=
rtsTrue
;
}
FD_SET
(
workerWakeupPipe
[
0
],
&
rfd
);
...
...
@@ -361,9 +345,10 @@ wakeBlockedWorkerThread()
{
if
(
isWorkerBlockedInAwaitEvent
&&
!
workerWakeupPending
)
{
unsigned
char
dummy
=
42
;
// Any value will do here
// write something so that select() wakes up
workerWakeupPending
=
rtsTrue
;
// write something so that select() wakes up
write
(
workerWakeupPipe
[
1
],
&
dummy
,
1
);
workerWakeupPending
=
rtsTrue
;
}
}
...
...
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