Idris2Doc : System.Posix.Pthreads

System.Posix.Pthreads

(source)

Reexports

importpublic Control.Monad.Resource
importpublic Data.C.Ptr
importpublic System.Posix.Errno
importpublic System.Posix.Pthreads.Struct
importpublic System.Posix.Pthreads.Types

Definitions

pthreadSelf : HasIOio=>ioPthreadT
  Returns the thread ID of the current thread.

Totality: total
Visibility: export
pthreadJoin : HasErrnoes=>EIO1f=>PthreadT->fes ()
  Blocks the current thread and waits for the given thread to terminate.

Totality: total
Visibility: export
mkmutex : HasErrnoes=>EIO1f=>MutexType->fesMutexT
  Allocates and initializes a new mutex of the given type.

This must be freed with `destroyMutex`.

Totality: total
Visibility: export
destroyMutex : HasIOio=>MutexT->io ()
  Destroys a mutex and frees the memory allocated for it.

Totality: total
Visibility: export
lockMutex : HasErrnoes=>EIO1f=>MutexT->fes ()
  Tries to lock the given mutex, blocking the calling thread
in case it is already locked.

Totality: total
Visibility: export
timedlockMutex : HasErrnoes=>EIO1f=>MutexT->ClockDuration->fesBool
  Like `lockMutex` but returns a boolean with `False` indicating
that the lock timed out

Totality: total
Visibility: export
trylockMutex : HasErrnoes=>EIO1f=>MutexT->fesBool
  Like `lockMutex` but returns `False` in case the mutex is
already locked.

Totality: total
Visibility: export
unlockMutex : HasErrnoes=>EIO1f=>MutexT->fes ()
  Unlocks the given mutex.

This is an error if the calling thread is not the one holding
the mutex's lock.

Totality: total
Visibility: export
mkcond : HasErrnoes=>EIO1f=>fesCondT
  Allocates and initializes a new condition variable.

This must be freed with `destroyCond`.

Totality: total
Visibility: export
destroyCond : HasIOio=>CondT->io ()
  Destroys a condition variable and frees the memory allocated for it.

Totality: total
Visibility: export
condSignal : HasErrnoes=>EIO1f=>CondT->fes ()
  Signals the given `pthread_cond_t`.

If several threads are waiting on the condition, it is unspecified
which of them will be signalled. We are only guaranteed that at least
of them will be woken up.

Totality: total
Visibility: export
condBroadcast : HasErrnoes=>EIO1f=>CondT->fes ()
  Broadcasts the given `pthread_cond_t`.

This will wake up all threads waiting on the given condition.

Totality: total
Visibility: export
condWait : HasErrnoes=>EIO1f=>CondT->MutexT->fes ()
  Blocks the given thread and waits for the given condition to
be signalled.

Note: The mutex must have been locked by the calling thread. The
lock is automatically released upon calling `condWait`, and when
the thread is woken up, the mutex will automatically be locked again.

Totality: total
Visibility: export
condTimedwait : HasErrnoes=>EIO1f=>CondT->MutexT->ClockUTC->fesBool
  Like `condWait` but will return `False` in case the operation timed out.

Totality: total
Visibility: export
pthreadCancel : HasErrnoes=>EIO1f=>PthreadT->fes ()
  Sends a cancelation request to the given thread.

Totality: total
Visibility: export
pthreadTestCancel : HasIOio=>io ()
  Tests for thread cancelation in the absence of other cancelation
points.

Totality: total
Visibility: export
setCancelType : HasIOio=>CancelType->ioCancelType
  Sets the current thread's cancel type returning the previous cancel type.

Totality: total
Visibility: export
setCancelState : HasIOio=>CancelState->ioCancelState
  Sets the current thread's cancel state returning the previous cancel state.

Totality: total
Visibility: export
pthreadSigmask : HasErrnoes=>EIO1f=>How->ListSignal->fes ()
  Adjust the thread's signal mask according to the given `How`
and signal set.

Totality: total
Visibility: export
pthreadSiggetmask : HasIOio=>ioSigsetT
  Returns the current signal mask of the thread.

Note: This allocates a new `sigset_t` pointer and returns the
previously set signal mask. Client code is responsible to
free the memory for this once it is no longer used.

Totality: total
Visibility: export
pthreadKill : HasErrnoes=>EIO1f=>PthreadT->Signal->fes ()
  Sends the given signal to the given thread.

Totality: total
Visibility: export