summaryrefslogtreecommitdiff
path: root/libraries/base/Control/Concurrent
Commit message (Collapse)AuthorAgeFilesLines
* Remove redundant "do", "return" and language extensions from baseHécate2020-09-233-3/+3
|
* Remove all the unnecessary LANGUAGE pragmasHécate2020-08-051-1/+0
|
* Use an IORef for QSemNDavid Feuer2019-10-231-39/+51
| | | | | | | Replace the outer `MVar` in `QSemN` with an `IORef`. This should probably be lighter, and it removes the need for `uninterruptibleMask`. Previously Differential Revision https://phabricator.haskell.org/D4896
* make QSem and QSemN newtypeschessai2018-12-172-5/+2
| | | | | | | | | | | | Reviewers: RyanGlScott, ekmett, hvr, bgamari Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15995 Differential Revision: https://phabricator.haskell.org/D5456
* Fix ambiguous/out-of-scope Haddock identifiersAlec Theriault2018-08-212-6/+6
| | | | | | | | | | | | | | | | | This drastically cuts down on the number of Haddock warnings when making docs for `base`. Plus this means more actual links end up in the docs! Also fixed other small mostly markup issues in the documentation along the way. This is a docs-only change. Reviewers: hvr, bgamari, thomie Reviewed By: thomie Subscribers: thomie, rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5055
* Unmask readMVar in readChanDavid Feuer2018-05-291-10/+1
| | | | | | | | | | | | | | | | When `readMVar` was implemented using `takeMVar` and `putMVar`, we needed to use `modifyMVarMasked` in `readChan` just in case the `readMVar` was interrupted between taking and putting. Now that `readMVar` uses an atomic primop, this is impossible, so we can safely unmask `readMVar`. Reviewers: hvr, bgamari, simonmar Reviewed By: simonmar Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4738
* Add @since annotations for derived instances in baseChaitanya Koparkar2018-03-021-1/+1
| | | | | | | | | | | | | | Test Plan: ./validate Reviewers: hvr, goldfire, bgamari, RyanGlScott Reviewed By: RyanGlScott Subscribers: rwbarton, thomie, carter GHC Trac Issues: #11767 Differential Revision: https://phabricator.haskell.org/D4452
* Various documentation improvementsSergey Vinokurov2018-02-141-2/+2
| | | | | | | | | | | | | | | * Fix missing code example in changelog for 8.4.1 * List 'setEnv' as opposite of 'getEnv' It seems best to direct users to use 'System.Environment.setEnv' rather than 'System.Posix.Env.putEnv'. This is due to 'setEnv' being located in the same module as 'getEnv' and my virtue of working on Windows platform, whereas 'putEnv' does not have that quality because it's part of the 'unix' package. * Reflect in docs the fact that 'readMVar' is not a composition of 'takeMVVar' and 'putMVar' any more
* Fixed misprint 'aqcuired'Kirill Zaborsky2017-12-112-2/+2
|
* base: Remove deprecated Chan combinatorsBen Gamari2017-10-031-23/+2
| | | | | | | | | | | | | | | Removes isEmptyChan and unGetChan, which have been deprecated for a very long time. See #13561. Test Plan: Validate Reviewers: austin, hvr Subscribers: rwbarton, thomie GHC Trac Issues: #13561 Differential Revision: https://phabricator.haskell.org/D4060
* Fix paper link in MVar docs [ci skip]Ömer Sinan Ağacan2017-07-021-1/+1
|
* Improve `readChan` documentation:Ömer Sinan Ağacan2017-04-101-1/+7
| | | | | | | | | | | | | | | | | - Mention that the read end is an `MVar`, so fairness guarantees are inherited. - Mention that it can throw `BlockedIndefinitelyOnMVar` exception. Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #5466 Differential Revision: https://phabricator.haskell.org/D3439
* base: Document caveats about Control.Concurrent.ChanErik de Castro Lopo2016-03-291-0/+5
| | | | | | | | | | | | | | | These are implemented using `MVars` which have known caveats. Suggest the use of `TChan` from the stm library instead. Test Plan: n/a Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2047
* Weak: Don't require wrapping/unwrapping of finalizersBen Gamari2015-09-251-4/+1
| | | | | | | | | | To quote Simon Marlow, We don't expect users to ever write code that uses mkWeak# or finalizeWeak#, we have safe interfaces to these. Let's document the type unsafety and fix the problem with () without introducing any overhead. Updates stm submodule.
* Remove references to () from types of mkWeak# and friendsBen Gamari2015-09-231-2/+5
| | | | | | | Previously the types needlessly used (), which is defined ghc-prim, leading to unfortunate import cycles. See #10867 for details. Updates stm submodule.
* base: drop redundant Typeable derivingsHerbert Valerio Riedel2015-03-073-7/+4
| | | | | | | | | | | Thanks to #9858 `Typeable` doesn't need to be explicitly derived anymore. This also makes `AutoDeriveTypeable` redundant, as well as some imports of `Typeable` (removal of whose may be beneficial to #9707). This commit removes several such now redundant use-sites in `base`. Reviewed By: austin, ekmett Differential Revision: https://phabricator.haskell.org/D712
* Convert `/Since: .../` to new `@since ...` syntaxHerbert Valerio Riedel2014-12-161-4/+4
| | | | | | Starting with Haddock 2.16 there's a new built-in support for since-annotations Note: This exposes a bug in the `@since` implementation (see e.g. `Data.Bits`)
* Improve Safe Haskell bounds for changes to base over timeDavid Terei2014-11-212-2/+2
|
* Remove redundant explicit `Prelude` importsHerbert Valerio Riedel2014-10-191-2/+0
| | | | Since they're implied by the lack of `NoImplicitPrelude`
* Replace DeriveDataTypeable by AutoDeriveTypeableHerbert Valerio Riedel2014-05-273-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a first step towards addressing #9111 This results in the following additional Typeable (exported) instances being generated (list was compiled by diff'ing hoogle txt output): instance Typeable CFile instance Typeable 'CFile instance Typeable CFpos instance Typeable 'CFpos instance Typeable CJmpBuf instance Typeable 'CJmpBuf instance Typeable ChItem instance Typeable QSem instance Typeable ID instance Typeable 'ID instance Typeable CONST instance Typeable Qi instance Typeable Qr instance Typeable Mp instance Typeable ConstrRep instance Typeable Fixity instance Typeable 'Prefix instance Typeable 'Infix instance Typeable Constr instance Typeable DataType instance Typeable DataRep instance Typeable Data instance Typeable HasResolution instance Typeable IsList Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Add `withMVarMasked` (re #8818)Herbert Valerio Riedel2014-02-251-0/+16
| | | | | | | | Like `withMVar`, but the @IO@ action in the second argument is executed with asynchronous exceptions masked. This completes the `MVar` API, which already contained `modifyMVarMasked` and `modifyMVarMasked_`. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Improve Haddock markupHerbert Valerio Riedel2014-01-302-3/+3
| | | | | | | | | | | This fixes the markup at the top of `Control.Arrow`, and improves the markup inside DEPRECATED strings. (Haddock supports markup inside DEPRECATED messages, which allows to turn references to Haskell entities into hyperlinks by using the usual Haddock markup.) Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Improve Haddock markup in `Control.Concurrent.MVar`Herbert Valerio Riedel2014-01-291-9/+11
| | | | | | | | This adds a labeled hyperlink to the Concurrent Haskell paper, and replaces the itemized-list headings with proper section headings (available since Haddock-2.14). Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Add Haddock `/Since: 4.6.0.0/` comments to symbolsHerbert Valerio Riedel2013-09-211-0/+6
| | | | | | | | | | This commit retroactively adds `/Since: 4.6.0.0/` annotations to symbols newly added/exposed in `base-4.6.0.0` (as shipped with GHC 7.6.1). See also 6368362f which adds the respective annotation for symbols newly added in `base-4.7.0.0` (that goes together with GHC 7.8.1). Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Make `<Typeable.h>` obsolete and refactor away its useHerbert Valerio Riedel2013-09-171-5/+1
| | | | | | | | | | | With GHC 7.8's PolyKinds the macros in `<Typeable.h>` are no longer of any use, and their use is clearly obsolete. The sites using those macros are replaced by auto-derivations of `Typeable` instances. This reduces reliance on the CPP extension and the compile dependency on `Typeable.h` in a couple of modules. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Constant-fold `__GLASGOW_HASKELL__` CPP conditionalsHerbert Valerio Riedel2013-09-174-16/+1
| | | | | | | | | | Now that HUGS and NHC specific code has been removed, this commit "folds" the now redundant `#if((n)def)`s containing `__GLASGOW_HASKELL__`. This renders `base` officially GHC only. This commit also removes redundant `{-# LANGUAGE CPP #-}`. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Remove Hugs98 specific codeHerbert Valerio Riedel2013-09-171-8/+0
| | | | | | | For rationale. see http://permalink.gmane.org/gmane.comp.lang.haskell.ghc.devel/2349 Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Fix #7787Simon Marlow2013-07-191-2/+2
| | | | | | Now the pair is evaluated strictly inside the exception handler. I figured this would be less likely to introduce space leaky bugs than using an irrefutable pattern match.
* Rename atomicReadMVar and friends to readMVar, replacing old readMVar.Edward Z. Yang2013-07-121-18/+3
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Fix build.Austin Seipp2013-07-111-1/+2
| | | | | | We forgot to import tryAtomicReadMVar. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Implement tryAtomicReadMVar.Edward Z. Yang2013-07-101-0/+1
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Add atomicReadMVar to Control.Concurrent.MVar and friends.Edward Z. Yang2013-07-091-1/+2
| | | | | | Also renumber thread statuses as necessary. Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* fix markup bugsSimon Marlow2013-07-021-4/+6
|
* Clarification what 'atomic' means here.Edward Z. Yang2013-06-141-1/+2
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Mark DEPRECATED pragmas with when they were addedIan Lynagh2013-02-162-3/+3
|
* Add back new working QSem and QSemN implementations (#7417)Simon Marlow2012-12-102-0/+260
| | | | | | | | | We decided not to break existing users without providing an easy migration path. For the time being I've made these implementations, which fix the bugs in the old versions and perform reasonably well. In due course we should move the concurrency functionality, including these modules, out of base and into a separate package.
* Remove commented types in module export listsIan Lynagh2012-10-272-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These comments are rather less useful now that haddock can give docs with the same informatino in the module synopsis. Having to maintain them when making changes to the library is a pain, and when people forget about doing so there is nothing that checks that the comments are right, so mistakes tend to linger. Of the comments that my script detected, 78 of 684 were already incorrect in one way or another, e.g. missing context: Text.Show.showsPrec Comment type: Int -> a -> ShowS Actual type: Show a => Int -> a -> ShowS wrong context: Numeric.readInt Comment type: Integral a => a -> (Char -> Bool) -> (Char -> Int) -> ReadS a Actual type: Num a => a -> (Char -> Bool) -> (Char -> Int) -> ReadS a not following a class change (e.g. Num losing its Eq superclass): Text.Read.Lex.readOctP Comment type: Num a => ReadP a Actual type: (Eq a, Num a) => ReadP a not following the Exceptions change: GHC.Conc.childHandler Comment type: Exception -> IO () Actual type: SomeException -> IO () or just always been wrong: GHC.Stable.deRefStablePtr Comment type: StablePtr a -> a Actual type: StablePtr a -> IO a
* Remove some deprecated modules and functionsIan Lynagh2012-07-203-309/+0
|
* add some UNPACKs to improve performance a bitSimon Marlow2012-07-041-3/+8
|
* Deprecate Control.Concurrent.{QSem,QSemNSampleVar}Ian Lynagh2012-06-233-0/+3
| | | | Also Control.Concurrent.{mergeIO,nmergeIO}, which use those modules.
* fix another theoretical deadlock bug in the Chan implementation (c.f. #6153)Simon Marlow2012-06-111-1/+10
|
* add modifyMVarMasked, modifyMVarMasked_Simon Marlow2012-06-111-13/+40
|
* add mkWeakMVar; deprecate addMVarFinalizer (#6130)Simon Marlow2012-06-041-3/+16
|
* Sealed writeChan with mask_ to prevent a theoretical bugJoey Adams2012-03-131-3/+15
|
* SafeHaskell: Added SafeHaskell to baseDavid Terei2011-06-185-0/+5
|
* docs: note strict sequential ordering of MVar operationsSimon Marlow2011-05-241-0/+7
|
* For GHC, implement the Typeable.hs macros using standalone derivingIan Lynagh2011-04-244-0/+12
| | | | | | As well as being more pleasant, this fixes #1841: Data.Typeable: Instances of basic types don't provide qualified strings to mkTyCon
* Add some more explanation to the skip channel example in the MVar docsIan Lynagh2011-02-261-3/+5
|
* Grammar fixIan Lynagh2011-02-251-1/+2
|
* Expand and clarify MVar documentation.Edward Z. Yang2011-01-161-11/+111
|