1. 05 Nov, 2020 1 commit
    • vdukhovni's avatar
      Naming, value types and tests for Addr# atomics · 17d5c518
      vdukhovni authored and  Marge Bot's avatar Marge Bot committed
      The atomic Exchange and CAS operations on integral types are updated to
      take and return more natural `Word#` rather than `Int#` values.  These
      are bit-block not arithmetic operations, and the sign bit plays no
      special role.
      
      Standardises the names to `atomic<OpType><ValType>Addr#`, where `OpType` is one
      of `Cas` or `Exchange` and `ValType` is presently either `Word` or `Addr`.
      Eventually, variants for `Word32` and `Word64` can and should be added,
      once #11953 and related issues (e.g. #13825) are resolved.
      
      Adds tests for `Addr#` CAS that mirror existing tests for
      `MutableByteArray#`.
      17d5c518
  2. 07 Oct, 2020 1 commit
    • Andreas Klebinger's avatar
      WinIO: Small changes related to atomic request swaps. · b41f7c38
      Andreas Klebinger authored and  Marge Bot's avatar Marge Bot committed
      Move the atomix exchange over the Ptr type to an internal module.
      
      Fix a bug caused by us passing ptr-to-ptr instead of ptr to
      atomic exchange.
      
      Renamed interlockedExchange to exchangePtr.
      
      I've also added an cas primitive. It turned out we don't need it
      for WinIO but I'm leaving it in as it's useful for other things.
      b41f7c38
  3. 15 Jul, 2020 1 commit
  4. 21 Aug, 2018 1 commit
    • Alec Theriault's avatar
      Fix ambiguous/out-of-scope Haddock identifiers · ddffa0cd
      Alec Theriault authored and Ben Gamari's avatar Ben Gamari committed
      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
      ddffa0cd
  5. 02 Mar, 2018 1 commit
  6. 07 Sep, 2017 1 commit
    • Herbert Valerio Riedel's avatar
      Make Semigroup a superclass of Monoid (re #14191) · 8ae263ce
      Herbert Valerio Riedel authored
      Unfortunately, this requires introducing a couple of .hs-boot files to
      break up import cycles (mostly to provide class & typenames in order to
      be able to write type signatures).
      
      This does not yet re-export `(<>)` from Prelude (while the class-name
      `Semigroup` is reexported); that will happen in a future commit.
      
      Test Plan: local ./validate passed
      
      Reviewers: ekmett, austin, bgamari, erikd, RyanGlScott
      
      Reviewed By: ekmett, RyanGlScott
      
      GHC Trac Issues: #14191
      
      Differential Revision: https://phabricator.haskell.org/D3927
      8ae263ce
  7. 18 Apr, 2017 1 commit
  8. 13 Mar, 2017 1 commit
  9. 06 Jun, 2016 1 commit
  10. 01 Jun, 2015 1 commit
    • Ben Gamari's avatar
      Fix dropped event registrations · 1c383259
      Ben Gamari authored
      D347 introduced a bug wherein the event manager would drop registrations that
      should be retained during processing. This occurs when an fd has multiple
      registrations, not all of which fire, as well as the case of multi-shot
      registrations.
      
      I also do some general house-keeping, try to better document things, and fix a
      bug which could result in unnecessary calls to `epoll_ctl`
      
      Reviewed By: austin
      
      Differential Revision: https://phabricator.haskell.org/D849
      
      GHC Trac Issues: #10317
      1c383259
  11. 25 Apr, 2015 1 commit
  12. 12 Jan, 2015 1 commit
    • Ben Gamari's avatar
      Event Manager: Make one-shot a per-registration property · 02343998
      Ben Gamari authored
      Summary:
      Currently the event manager has a global flag for whether to create
      epoll-like notifications as one-shot (e.g. EPOLLONESHOT, where an fd
      will be deactivated after its first event) or standard multi-shot
      notifications.
      
      Unfortunately this means that the event manager may export either
      one-shot or multi-shot semantics to the user. Even worse, the user has
      no way of knowing which semantics are being delivered. This resulted in
      breakage in the usb[1] library which deadlocks after notifications on
      its fd are disabled after the first event is delivered.  This patch
      reworks one-shot event support to allow the user to choose whether
      one-shot or multi-shot semantics are desired on a per-registration
      basis. The event manager can then decide whether to use a one-shot or
      multi-shot epoll.
      
      A registration is now defined by a set of Events (as before) as well as
      a Lifetime (either one-shot or multi-shot). We lend monoidal structure
      to Lifetime choosing OneShot as the identity. This allows us to combine
      Lifetime/Event pairs of an fd to give the longest desired lifetime of
      the registration and the full set of Events for which we want
      notification.
      
      [1] https://github.com/basvandijk/usb/issues/7
      
      Test Plan: Add more test cases and validate
      
      Reviewers: tibbe, AndreasVoellmy, hvr, austin
      
      Reviewed By: austin
      
      Subscribers: thomie, carter, simonmar
      
      Differential Revision: https://phabricator.haskell.org/D347
      02343998
  13. 20 Sep, 2014 1 commit
    • Herbert Valerio Riedel's avatar
      Set up framework for generalising Data.List to Foldables · 3daf0023
      Herbert Valerio Riedel authored
      This renames the Data.List module to Data.OldList, and puts a new
      Data.List module into its place re-exporting all list functions.
      
      The plan is to leave the monomorphic versions of the list functions in
      Data.OldList to help smooth the transition.
      
      The new Data.List module then will simply re-export entities from
      Data.OldList and Data.Foldable.
      
      This refactoring has been placed in a separate commit to be able to
      better isolate any regressions caused by the actual list function
      generalisations when implementing #9586
      
      This also updates the haskell2010, haskell98, and array submodules
      
      Reviewed By: austin, ekmett
      
      Differential Revision: https://phabricator.haskell.org/D228
      3daf0023
  14. 16 Sep, 2014 1 commit
  15. 09 Sep, 2014 1 commit
    • Austin Seipp's avatar
      Make Applicative a superclass of Monad · d94de872
      Austin Seipp authored
      
      
      Summary:
      This includes pretty much all the changes needed to make `Applicative`
      a superclass of `Monad` finally. There's mostly reshuffling in the
      interests of avoid orphans and boot files, but luckily we can resolve
      all of them, pretty much. The only catch was that
      Alternative/MonadPlus also had to go into Prelude to avoid this.
      
      As a result, we must update the hsc2hs and haddock submodules.
      Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
      
      Test Plan: Build things, they might not explode horribly.
      
      Reviewers: hvr, simonmar
      
      Subscribers: simonmar
      
      Differential Revision: https://phabricator.haskell.org/D13
      d94de872
  16. 06 May, 2013 1 commit
    • AndreasVoellmy's avatar
      Update parallel IO manager to handle the invalid files in the same way as previous IO manager. · c5a4de9d
      AndreasVoellmy authored
      This patch affects the IO manager using kqueue. See issue #7773. If the kqueue backend cannot wait for events on a file, it will simply call the registered callback for the file immediately. This is the behavior of the previous IO manager. This is not ideal, but it is an initial step toward dealing with the problem properly. Ideally, we would use a non-kqueue mechanism for waiting on files (select seems most reliable) that cannot be waited on with kqueue.
      c5a4de9d
  17. 12 Feb, 2013 2 commits
  18. 25 Oct, 2011 1 commit
  19. 12 Oct, 2011 1 commit
  20. 21 Mar, 2011 1 commit
  21. 26 Nov, 2010 1 commit
    • bos's avatar
      Fix #4514 - IO manager deadlock · 79cf73c5
      bos authored
      * The public APIs for threadWaitRead and threadWaitWrite remain unchanged,
        and now throw an IOError if a file descriptor is closed behind their
        backs.  This behaviour is documented.
      
      * The GHC.Conc API is extended to add a closeFd function, the behaviour
        of which is documented.
      
      * Behind the scenes, we add a new evtClose event, which is used only when
        one thread closes a file descriptor that other threads are blocking on.
      
      * Both base's IO code and network use the new closeFd function.
      79cf73c5
  22. 10 Aug, 2010 1 commit