2020-11-11 01:19:49 +03:00
..
2020-11-11 01:19:49 +03:00
2020-11-11 01:19:49 +03:00
2020-11-11 01:19:49 +03:00
2020-11-11 01:19:49 +03:00
2020-11-11 01:19:49 +03:00
2020-11-11 01:19:49 +03:00

Mutex

Overview

  • Mutex wrapper for Windows and POSIX systems.
  • Just copy sc_mutex.h and sc_mutex.c to your project.

Usage

#include "sc_mutex.h"

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

    sc_mutex_init(&mutex);

    sc_mutex_lock(&mutex);
    // Exclusive area.
    sc_mutex_unlock(&mutex);

    sc_mutex_term(&mutex);

    return 0;
}