SomeGameEngineV2/engine/base/sc_extra/mutex
En Yi ea4c1216e0 First commit of Engine V2
Changelog:
- Integrate custom memory arena with o1heap
- Integrate sc and cc for data structures
    - integrate with o1heap for dynamic memory
- Add some tests
2024-12-28 15:07:05 +08:00
..
CMakeLists.txt First commit of Engine V2 2024-12-28 15:07:05 +08:00
README.md First commit of Engine V2 2024-12-28 15:07:05 +08:00
sc_mutex.c First commit of Engine V2 2024-12-28 15:07:05 +08:00
sc_mutex.h First commit of Engine V2 2024-12-28 15:07:05 +08:00

README.md

Mutex

Mutex wrapper

  • Basic mutex wrapper for Posix and Windows.

#include "sc_mutex.h"

int main(int argc, char *argv[])
{
    struct sc_mutex mutex;

    sc_mutex_init(&mutex); // Init mutex

    sc_mutex_lock(&mutex);
    sc_mutex_unlock(&mutex);

    sc_mutex_term(&mutex); // destroy mutex

    return 0;
}