Skip to content

Conversation

scottatchley
Copy link
Contributor

Enabling this option initializes mutexes with a
pthread_mutexattr_type of PTHREAD_MUTEX_ERRORCHECK.
All locks and unlocks will then check the return value
and abort() if there is an error.

We define these macros:

CCI_LOCK_INIT(x)
CCI_LOCK_DESTROY(x)
CCI_LOCK(x)
CCI_UNLOCK(x)

There is no need to initialize and pass a pthread_mutexattr_t
to CCI_LOCK_INIT().

This patch only alters src/api. It does not add this to any
transports.

To use them, simply replace the pthread_mutex_* with the CCI_*
equivalent. The macros cannot return a value, so do not try to
error check them. If you need error checking, use the configure
option.

Enabling this option initializes mutexes with a
pthread_mutexattr_type of PTHREAD_MUTEX_ERRORCHECK.
All locks and unlocks will then check the return value
and abort() if there is an error.

We define these macros:

CCI_LOCK_INIT(x)
CCI_LOCK_DESTROY(x)
CCI_LOCK(x)
CCI_UNLOCK(x)

There is no need to initialize and pass a pthread_mutexattr_t
to CCI_LOCK_INIT().

This patch only alters src/api. It does _not_ add this to any
transports.

To use them, simply replace the pthread_mutex_* with the CCI_*
equivalent. The macros cannot return a value, so do not try to
error check them. If you need error checking, use the configure
option.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant