An open API service indexing awesome lists of open source software.

https://github.com/valkryst/c_mutex

A wrapper which simplifies the creation, destruction, and use of mutex locks.
https://github.com/valkryst/c_mutex

mutex mutex-lock mutex-synchronisation pthreads pthreads-wrapper wrapper

Last synced: about 1 month ago
JSON representation

A wrapper which simplifies the creation, destruction, and use of mutex locks.

Awesome Lists containing this project

README

        

The foci of this repository are the [mutex.c](https://github.com/Valkryst/C_Mutex/blob/main/src/mutex.c)
and [mutex.h](https://github.com/Valkryst/C_Mutex/blob/main/src/mutex.h)
files. They simplify the creation, destruction, and use of
[mutex locks](https://en.wikipedia.org/wiki/Lock_(computer_science)).

## Compiling

Add `mutex.c` and `mutex.h` to your project, and add
[-pthread flag](https://stackoverflow.com/a/2127819/13279616) to your compile
flags.

See the provided [Makefile](https://github.com/Valkryst/C_Mutex/blob/main/Makefile)
as a reference.

## Dependencies

For development purposes, `mutex.c` depends on my
[C_Logging](https://github.com/Valkryst/C_Logging) library. By replacing all
calls to `printError` in `mutex.c`, you can remove this dependency.