BMOSP/include/lock.h

30 lines
749 B
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* lock.h
* Заголовок с функциями блокировок
*
* Данный заголовочный файл содержит определения которые используются для работы
* с блокировками ресурсов
*
*/
#ifndef LOCK_H
#define LOCK_H
#include <stdint.h>
typedef struct {
int lock;
const char* file;
} lock_t;
#define LOCK_INIT \
(lock_t) { \
0, __FILE__ \
}
int lock_swap(lock_t* lock);
void lock_acquire(lock_t* lock);
void lock_release(lock_t* lock);
#endif // lock.h