commit ghc-stm for openSUSE:Factory
Hello community, here is the log from the commit of package ghc-stm for openSUSE:Factory checked in at 2013-08-01 15:33:48 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-stm (Old) and /work/SRC/openSUSE:Factory/.ghc-stm.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "ghc-stm" Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-stm/ghc-stm.changes 2013-01-01 11:59:58.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.ghc-stm.new/ghc-stm.changes 2013-08-01 15:33:49.000000000 +0200 @@ -1,0 +2,8 @@ +Mon May 6 09:56:37 UTC 2013 - peter.trommler@ohm-hochschule.de + +- update to 2.4.2 from upstream +* new feature: transactional semaphore +- part of update to Haskell Platform 2013.2 +- more transparent packaging (fewer macros) + +------------------------------------------------------------------- Old: ---- stm-2.4.tar.gz New: ---- stm-2.4.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-stm.spec ++++++ --- /var/tmp/diff_new_pack.oRnz6a/_old 2013-08-01 15:33:50.000000000 +0200 +++ /var/tmp/diff_new_pack.oRnz6a/_new 2013-08-01 15:33:50.000000000 +0200 @@ -1,8 +1,7 @@ # -# spec file for ghc-stm +# spec file for package ghc-stm # - -# Copyright (c) 2012 Peter Trommler peter.trommler@ohm-hochschule.de +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,6 +15,7 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # + %global pkg_name stm %global common_summary Haskell Software Transactional Memory library @@ -23,48 +23,57 @@ %global common_description A modular composable concurrency abstraction library for Haskell. Name: ghc-stm -Version: 2.4 -Release: 1 +Version: 2.4.2 +Release: 0 Summary: %{common_summary} - -Group: System/Libraries License: BSD-3-Clause +Group: System/Libraries + BuildRoot: %{_tmppath}/%{name}-%{version}-build # BEGIN cabal2spec -URL: http://hackage.haskell.org/package/%{pkg_name} +Url: http://hackage.haskell.org/package/%{pkg_name} Source0: http://hackage.haskell.org/packages/archive/%{pkg_name}/%{version}/%{pkg_name}-%{version}.tar.gz ExclusiveArch: %{ix86} x86_64 %{ghc_arches} BuildRequires: ghc-Cabal-devel -BuildRequires: ghc-rpm-macros %{!?without_hscolour:hscolour} BuildRequires: ghc-array-devel +BuildRequires: ghc-rpm-macros # END cabal2spec %description %{common_description} +%package devel +Summary: Haskell %{pkg_name} library development files +Group: Development/Languages/Other +Requires: ghc-compiler +Requires(post): ghc-compiler +Requires(postun): ghc-compiler +Requires: %{name} = %{version}-%{release} + +%description devel +%{common_description} +This package contains the development files. %prep %setup -q -n %{pkg_name}-%{version} - %build %ghc_lib_build - %install %ghc_lib_install +%post devel +%ghc_pkg_recache -# devel subpackage -%ghc_devel_package - -%ghc_devel_description - - -%ghc_devel_post_postun - +%postun devel +%ghc_pkg_recache -%ghc_files LICENSE +%files -f %{name}.files +%defattr(-,root,root,-) +%doc LICENSE +%files devel -f %{name}-devel.files +%defattr(-,root,root,-) %changelog ++++++ stm-2.4.tar.gz -> stm-2.4.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stm-2.4/Control/Concurrent/STM/TChan.hs new/stm-2.4.2/Control/Concurrent/STM/TChan.hs --- old/stm-2.4/Control/Concurrent/STM/TChan.hs 2012-07-04 13:32:07.000000000 +0200 +++ new/stm-2.4.2/Control/Concurrent/STM/TChan.hs 2012-11-16 22:50:02.000000000 +0100 @@ -97,9 +97,8 @@ -- garbage collected after clients have seen them. newBroadcastTChan :: STM (TChan a) newBroadcastTChan = do - dummy_hole <- newTVar TNil write_hole <- newTVar TNil - read <- newTVar dummy_hole + read <- newTVar (error "reading from a TChan created by newBroadcastTChan; use dupTChan first") write <- newTVar write_hole return (TChan read write) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stm-2.4/Control/Concurrent/STM/TSem.hs new/stm-2.4.2/Control/Concurrent/STM/TSem.hs --- old/stm-2.4/Control/Concurrent/STM/TSem.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/stm-2.4.2/Control/Concurrent/STM/TSem.hs 2012-11-16 22:50:02.000000000 +0100 @@ -0,0 +1,54 @@ +----------------------------------------------------------------------------- +-- | +-- Module : Control.Concurrent.STM.TSem +-- Copyright : (c) The University of Glasgow 2012 +-- License : BSD-style (see the file libraries/base/LICENSE) +-- +-- Maintainer : libraries@haskell.org +-- Stability : experimental +-- Portability : non-portable (requires STM) +-- +-- 'TSem': transactional semaphores. +-- +----------------------------------------------------------------------------- + +{-# LANGUAGE DeriveDataTypeable #-} +module Control.Concurrent.STM.TSem ( + TSem, newTSem, waitTSem, signalTSem + ) where + +import Control.Concurrent.STM +import Control.Monad +import Data.Typeable +import Control.Exception + +-- | 'TSem' is a transactional semaphore. It holds a certain number +-- of units, and units may be acquired or released by 'waitTSem' and +-- 'signalTSem' respectively. When the 'TSem' is empty, 'waitTSem' +-- blocks. +-- +-- Note that 'TSem' has no concept of fairness, and there is no +-- guarantee that threads blocked in `waitTSem` will be unblocked in +-- the same order; in fact they will all be unblocked at the same time +-- and will fight over the 'TSem'. Hence 'TSem' is not suitable if +-- you expect there to be a high number of threads contending for the +-- resource. However, like other STM abstractions, 'TSem' is +-- composable. +-- +newtype TSem = TSem (TVar Int) + deriving (Eq, Typeable) + +newTSem :: Int -> STM TSem +newTSem i = fmap TSem (newTVar i) + +waitTSem :: TSem -> STM () +waitTSem (TSem t) = do + i <- readTVar t + when (i <= 0) retry + writeTVar t $! (i-1) + +signalTSem :: TSem -> STM () +signalTSem (TSem t) = do + i <- readTVar t + writeTVar t $! i+1 + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stm-2.4/Control/Monad/STM.hs new/stm-2.4.2/Control/Monad/STM.hs --- old/stm-2.4/Control/Monad/STM.hs 2012-07-04 13:32:07.000000000 +0200 +++ new/stm-2.4.2/Control/Monad/STM.hs 2012-11-16 22:50:02.000000000 +0100 @@ -57,13 +57,29 @@ #ifdef __GLASGOW_HASKELL__ #if ! (MIN_VERSION_base(4,3,0)) +import Control.Applicative +import Control.Monad (ap) +#endif +#endif + + +#ifdef __GLASGOW_HASKELL__ +#if ! (MIN_VERSION_base(4,3,0)) instance MonadPlus STM where mzero = retry mplus = orElse + +instance Applicative STM where + pure = return + (<*>) = ap + +instance Alternative STM where + empty = retry + (<|>) = orElse #endif -check :: Bool -> STM a -check b = if b then return undefined else retry +check :: Bool -> STM () +check b = if b then return () else retry #endif #if ! (MIN_VERSION_base(4,3,0)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stm-2.4/stm.cabal new/stm-2.4.2/stm.cabal --- old/stm-2.4/stm.cabal 2012-07-04 13:32:07.000000000 +0200 +++ new/stm-2.4.2/stm.cabal 2012-11-16 22:50:02.000000000 +0100 @@ -1,5 +1,5 @@ name: stm -version: 2.4 +version: 2.4.2 license: BSD3 license-file: LICENSE maintainer: libraries@haskell.org @@ -8,6 +8,14 @@ description: A modular composable concurrency abstraction. . + Changes in version 2.4.2 + . + * Added "Control.Concurrent.STM.TSem" (transactional semaphore) + . + Changes in version 2.4.1 + . + * Added Applicative/Alternative instances of STM for GHC <7.0 + . Changes in version 2.4 . * Added "Control.Concurrent.STM.TQueue" (a faster @TChan@) @@ -40,6 +48,7 @@ Control.Concurrent.STM.TMVar Control.Concurrent.STM.TQueue Control.Concurrent.STM.TBQueue + Control.Concurrent.STM.TSem Control.Monad.STM other-modules: Control.Sequential.STM -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de