Ticket #4504: 4504-1.bundle

File 4504-1.bundle, 9.4 KB (added by adept, 2 years ago)

Excluded check for THREADED_RTS, import rtsSupportsBoundThreads from Control.Concurrent

Line 
11 patch for repository /home/adept/work/well-typed/parallel/kazu/ghc-src/ghc/libraries/unix:
2
3Wed Dec  8 10:21:25 EET 2010  Dmitry Astapov <dastapov@gmail.com>
4  * Fix for #4504: awaitSignal now works with threaded RTS
5
6New patches:
7
8[Fix for #4504: awaitSignal now works with threaded RTS
9Dmitry Astapov <dastapov@gmail.com>**20101208082125
10 Ignore-this: 34d8278d18f7776e211ac6e61f0e5bc5
11] {
12hunk ./System/Posix/Signals.hsc 109
13 import System.Posix.Internals
14 import System.Posix.Process
15 import System.Posix.Process.Internals
16+import Control.Concurrent (rtsSupportsBoundThreads)
17 import Data.Dynamic
18 
19 #ifdef __GLASGOW_HASKELL__
20hunk ./System/Posix/Signals.hsc 569
21 -- | @awaitSignal iset@ suspends execution until an interrupt is received.
22 -- If @iset@ is @Just s@, @awaitSignal@ calls @sigsuspend@, installing
23 -- @s@ as the new signal mask before suspending execution; otherwise, it
24--- calls @pause@.  @awaitSignal@ returns on receipt of a signal.  If you
25--- have installed any signal handlers with @installHandler@, it may be
26--- wise to call @yield@ directly after @awaitSignal@ to ensure that the
27+-- calls @sigsuspend@ with current signal mask. With threaded RTS,
28+-- scheduler timer (either @virtualTimerExpired@ or @realTimeAlarm@)
29+-- is always added to the signal mask passed to @sigsuspend@ to
30+-- prevent this call from waking up on context switches.
31+--
32+-- @awaitSignal@ returns when signal was received and processed by a
33+-- signal handler, or if the signal could not be caught. If you have
34+-- installed any signal handlers with @installHandler@, it may be wise
35+-- to call @yield@ directly after @awaitSignal@ to ensure that the
36 -- signal handler runs as promptly as possible.
37 awaitSignal :: Maybe SignalSet -> IO ()
38 awaitSignal maybe_sigset = do
39hunk ./System/Posix/Signals.hsc 581
40-  fp <- case maybe_sigset of
41-         Nothing -> do SignalSet fp <- getSignalMask; return fp
42-         Just (SignalSet fp) -> return fp
43+  sigset <- case maybe_sigset of
44+             Nothing -> getSignalMask
45+             Just s -> return s
46+  let SignalSet fp =
47+        case rtsSupportsBoundThreads of
48+          False -> sigset
49+          True -> addSignal itimerSignal sigset -- Fix for #4504
50   withForeignPtr fp $ \p -> do
51   _ <- c_sigsuspend p
52   return ()
53hunk ./System/Posix/Signals.hsc 595
54   -- (-1) with errno set to EINTR.
55   -- XXX My manpage says it can also return EFAULT. And why is ignoring
56   -- EINTR the right thing to do?
57-
58+  where
59+    itimerSignal =
60+#if defined(USE_TIMER_CREATE)
61+      virtualTimerExpired
62+#elif defined(HAVE_SETITIMER)
63+#  if !defined(HAVE_SETITIMER_VIRTUAL)
64+      realTimeAlarm
65+#  else
66+      virtualTimerExpired
67+#  endif
68+#endif
69+
70 foreign import ccall unsafe "sigsuspend"
71   c_sigsuspend :: Ptr CSigset -> IO CInt
72 #endif
73}
74
75Context:
76
77[Remove unnecessary fromIntegral calls
78simonpj@microsoft.com**20101116172536
79 Ignore-this: e77072c759445a64892738618ff03ea8
80]
81[Bump version to 2.4.1.0
82Ian Lynagh <igloo@earth.li>**20100917150114]
83[avoid Foreign.unsafePerformIO
84Ross Paterson <ross@soi.city.ac.uk>**20100909125459
85 Ignore-this: 890c8460db98d1ec18168d70291be9f1
86]
87[Add bindings for setting effective user-id and group-id
88Eric Mertens <emertens@galois.com>**20100517181945
89 Ignore-this: 49f72b40befb133cdbf63742a389dad5
90 
91 Having the ability to set the effective user-id and group-id
92 enables the application to switch between the real user-id
93 and set-user-id multiple times.
94]
95[Allow base-4.3
96Simon Marlow <marlowsd@gmail.com>**20100602082509
97 Ignore-this: 5d6dea210a68d3f290f69ee1feb1488a
98]
99[add a comment about 3816 failing due to Samba
100Simon Marlow <marlowsd@gmail.com>**20100518084422
101 Ignore-this: daf0c2087064925e67b1a5a09ce7632c
102]
103[Provide a dummy input file for queryfdoption01
104Matthias Kilian <kili@outback.escape.de>**20100418172619
105 Ignore-this: 4d7bfb388193ff6090f4a5fcfe798bbe
106]
107[mention that forkProcess is not supported with +RTS -Nn where n > 1
108Simon Marlow <marlowsd@gmail.com>**20100430082841
109 Ignore-this: c7bc7e8262bc72244061a9aba2dd468d
110]
111[make getAllGroupEntries work when called again; fixes #3816
112Simon Marlow <marlowsd@gmail.com>**20100329112713
113 Ignore-this: 8b5e3c1d8648d556b9f032a198a8475d
114]
115[add test for #3816
116Simon Marlow <marlowsd@gmail.com>**20100329112646
117 Ignore-this: 4d07e5956a5bc6dfb7be59473ccf6b98
118]
119[fix warnings
120Simon Marlow <marlowsd@gmail.com>**20100322131615
121 Ignore-this: 9fd97646b47d5d8d2957c0927885041e
122]
123[handleToFd: close both sides of a DuplexHandle (#3914)
124Simon Marlow <marlowsd@gmail.com>**20100319210802
125 Ignore-this: d1c17df79644a7ad140099d0c1474c81
126]
127[check for EINTR in openFd
128Simon Marlow <marlowsd@gmail.com>**20100127114600
129 Ignore-this: 28859b6a74c6d47d5c92db0eb688fa4c
130]
131[accept --with-cc to set the path to gcc (#2966)
132Simon Marlow <marlowsd@gmail.com>**20100127114329
133 Ignore-this: 127eccfccbfc849ce05aed5904d16b75
134]
135[System.Posix.Temp: rm whitespace
136gwern0@gmail.com**20100119003437
137 Ignore-this: 33b2bcf99f7b6b21461ea0aee7c12ea8
138]
139[System.Posix.Temp: pad input filenames with 6 Xs
140gwern0@gmail.com**20100119003022
141 Ignore-this: 1e5a45074881f75d58e3a0f02525b264
142 If the argument doesn't terminate in capital Xs, the C mkstemp will simply bomb out
143 with zero warning. This was not documented.
144 By arbitrarily sticking a bunch of Xes at the end of all arguments, we guarantee that
145 this exception will not be thrown, the type signature will not change, and no existing
146 code can break (since if it was manually avoiding the exception by adding "XXX" itself,
147 the temp files will now be simply 3 random characters longer, nothing worse).
148]
149[System.Posix.Temp: improve haddocks for mkstemp to explain what that returned String actually is
150gwern0@gmail.com**20100119002755
151 Ignore-this: 5f5ec7871a687a024cda18b1b0d1e044
152]
153[fix base dependency: should be >= 4.2 (#3780), and bump verison to 2.4.0.1
154Simon Marlow <marlowsd@gmail.com>**20100113113803
155 Ignore-this: 121b61a9ea1ce1dcbe499285d1910d25
156]
157[no good reason these tests should be expect_fail, as far as I can tell
158Simon Marlow <marlowsd@gmail.com>**20091231145739
159 Ignore-this: a8f0dcb753f8520fb6953b7f9acd50c6
160]
161[Support for DragonFly
162Simon Marlow <marlowsd@gmail.com>**20091221110709
163 Ignore-this: cafb4888bc25aa8ed97ce947acabfaca
164 Not sure where this patch came from, I found it in my validate tree.
165]
166[Don't use absolute paths to headers (#3728)
167Simon Marlow <marlowsd@gmail.com>**20091221110634
168 Ignore-this: 64b17ec4d274fdc5bd9ee021d412c997
169]
170[Add Haiku (#3727)
171Simon Marlow <marlowsd@gmail.com>**20091221110554
172 Ignore-this: a76b1450c341d80312f1354efa95c8a0
173]
174[#include <fcntl.h>, not <sys/fcntl.h> (#3723)
175Simon Marlow <marlowsd@gmail.com>**20091216104154
176 Ignore-this: 9f11594ce66b2e2537b9a20a33912e0d
177]
178[forking works in GHCi too
179Simon Marlow <marlowsd@gmail.com>**20091111142055
180 Ignore-this: 90ead989e64e3cbffbae15e0c74b5f89
181 Or at least, it works well enough to run this test.  The main GHCi
182 thread is gone after forking, but the current evaluation continues to
183 run.
184]
185[add a test for #1185
186Simon Marlow <marlowsd@gmail.com>**20091021090741
187 Ignore-this: 581e367a446bc4a3996b09d39fbb102b
188]
189[run fdReadBuf only the threaded ways (fixed unregisterised failure)
190Simon Marlow <marlowsd@gmail.com>**20091008110126
191 Ignore-this: 7893c3ab18b25aa3c67b71633a1e7d35
192]
193[Add a test from trac #2969
194Ian Lynagh <igloo@earth.li>**20090923194837]
195[Bump version to 2.4.0.0
196Ian Lynagh <igloo@earth.li>**20090920142001]
197[Add comments about why user001 might fail on Linux.
198Simon Marlow <marlowsd@gmail.com>**20090917134046
199 See  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=466647
200]
201[Allow building with base 4.2
202Ian Lynagh <igloo@earth.li>**20090911160736]
203[remove dead code
204Simon Marlow <marlowsd@gmail.com>**20090908144627
205 Ignore-this: f7e3696e27307be289f9fbf85750fab8
206]
207[Use Foreign.Concurrent for Haskell finalizers (#3473)
208Simon Marlow <marlowsd@gmail.com>**20090908142536
209 Ignore-this: 72ce9a134562b451b0237e124d03c839
210]
211[Update to follow RTS tidyp changes
212Simon Marlow <marlowsd@gmail.com>**20090801193459
213 Ignore-this: 825b19edb4cee29945b179f21a8538e4
214]
215[NetBSD does not have support for symbol versioning, so updated systen
216Simon Marlow <marlowsd@gmail.com>**20090723075725
217 Ignore-this: 19a0cc5a913ba591074aab6c560ff5d8
218 functions need to be given a new name, and the header files contain
219 some __asm hackery in order to let the program call the correct function.
220 
221 This mean that you need to use the header files in order to call the
222 correct system functions, which prevents things like "foreign import ccall" from working.
223 
224 Ghc solves this with wrapper functions for some of the renamed functions,
225 but it has not been updated for newer versions of NetBSD that has recently
226 versioned some more functions.
227 
228 The attached patches introduces wrapper functions for all currently
229 NetBSD-versioned functions used in libraries/unix.  Solves ~20 testsuite
230 failures.
231 
232 Contributed by: Krister Walfridsson <krister.walfridsson@gmail.com>
233]
234[Fix warning
235Ian Lynagh <igloo@earth.li>**20090711112701]
236[Fix some "warn-unused-do-bind" warnings where we want to ignore the value
237Ian Lynagh <igloo@earth.li>**20090710200806]
238[Remove unused imports
239Ian Lynagh <igloo@earth.li>**20090707115900]
240[Move directory stuff from base to here
241Simon Marlow <marlowsd@gmail.com>**20090625093258
242 Ignore-this: cd2ce9c12bac46285b5435f00c50a21e
243 leaving out Windows-specific hacks
244]
245[rename cache variables to keep recent autoconfs happy
246Ross Paterson <ross@soi.city.ac.uk>**20090616140611
247 Ignore-this: b522604509c77edeff37b3ec42f3741f
248]
249[TAG 2009-06-25
250Ian Lynagh <igloo@earth.li>**20090625160426]
251Patch bundle hash:
2526907e120734ddfaeedf497472aba4a0722c7957a