| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
System.Semaphore.Internal.Common
Synopsis
- data SemaphoreName = SemaphoreName {}
- type SemaphoreIdentifier = String
- newtype SemaphoreProtocolVersion = SemaphoreProtocolVersion {}
- data SemaphoreError
- = SemaphoreAlreadyExists { }
- | SemaphoreDoesNotExist { }
- | SemaphoreIncompatibleVersion { }
- | SemaphoreOtherError { }
- semaphoreVersion :: SemaphoreProtocolVersion
- semaphoreIdentifier :: SemaphoreName -> SemaphoreIdentifier
- parseSemaphoreIdentifier :: SemaphoreIdentifier -> Maybe SemaphoreName
- getSemaphoreSocketPath :: SemaphoreName -> IO FilePath
- iToBase62 :: Int -> String
Documentation
data SemaphoreName Source #
A semaphore name: a protocol version and an unversioned name string.
Constructors
| SemaphoreName | |
Instances
| Show SemaphoreName Source # | |
Defined in System.Semaphore.Internal.Common Methods showsPrec :: Int -> SemaphoreName -> ShowS # show :: SemaphoreName -> String # showList :: [SemaphoreName] -> ShowS # | |
| Eq SemaphoreName Source # | |
Defined in System.Semaphore.Internal.Common Methods (==) :: SemaphoreName -> SemaphoreName -> Bool # (/=) :: SemaphoreName -> SemaphoreName -> Bool # | |
type SemaphoreIdentifier = String Source #
The identifier string of a semaphore, as serialised for transport
between processes (e.g. on a command line via -jsem).
For version 1 this is a bare name; for version N (with N >= 2)
this is "v<N>-<name>".
newtype SemaphoreProtocolVersion Source #
The protocol version of a semaphore.
Constructors
| SemaphoreProtocolVersion | |
Fields | |
Instances
data SemaphoreError Source #
Errors that can occur when creating or opening a semaphore.
Constructors
| SemaphoreAlreadyExists | |
Fields | |
| SemaphoreDoesNotExist | |
Fields | |
| SemaphoreIncompatibleVersion | |
| SemaphoreOtherError | |
Fields | |
Instances
| Exception SemaphoreError Source # | |
Defined in System.Semaphore.Internal.Common Methods toException :: SemaphoreError -> SomeException # fromException :: SomeException -> Maybe SemaphoreError # displayException :: SemaphoreError -> String # backtraceDesired :: SemaphoreError -> Bool # | |
| Show SemaphoreError Source # | |
Defined in System.Semaphore.Internal.Common Methods showsPrec :: Int -> SemaphoreError -> ShowS # show :: SemaphoreError -> String # showList :: [SemaphoreError] -> ShowS # | |
| Eq SemaphoreError Source # | |
Defined in System.Semaphore.Internal.Common Methods (==) :: SemaphoreError -> SemaphoreError -> Bool # (/=) :: SemaphoreError -> SemaphoreError -> Bool # | |
semaphoreVersion :: SemaphoreProtocolVersion Source #
The protocol version on this platform.
The version tracks the IPC mechanism, not the library version:
- POSIX: 2 (domain sockets, replacing v1 system semaphores).
- Windows: 1 (Win32 named semaphores, unchanged from v1).
- Unsupported platforms: 0 (no compatible IPC backend).
Because the version is 1 on Windows, semaphoreIdentifier produces
a bare name (no v<N>- prefix), matching the v1 format.
semaphoreIdentifier :: SemaphoreName -> SemaphoreIdentifier Source #
The serialised identifier of a SemaphoreName for transport
between processes.
For version 1 this is the bare name; for version N (N >= 2) the
name is prefixed with v<N>-.
parseSemaphoreIdentifier :: SemaphoreIdentifier -> Maybe SemaphoreName Source #
Parse a SemaphoreIdentifier into a SemaphoreName.
Returns Nothing for unversioned strings (which should be treated as
v1 by the caller's compatibility logic).
getSemaphoreSocketPath :: SemaphoreName -> IO FilePath Source #
The socket file path for a semaphore.