File: optional_mutex.h

package info (click to toggle)
spiped 1.6.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,328 kB
  • sloc: ansic: 11,951; sh: 1,081; makefile: 629; perl: 121
file content (20 lines) | stat: -rw-r--r-- 537 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef OPTIONAL_MUTEX_H_
#define OPTIONAL_MUTEX_H_

#include <pthread.h>

/**
 * optional_mutex_lock(mutex):
 * If OPTIONAL_MUTEX_PTHREAD_YES is defined, call pthread_mutex_lock();
 * if OPTIONAL_MUTEX_PTHREAD_NO is defined, do nothing.
 */
int optional_mutex_lock(pthread_mutex_t *);

/**
 * optional_mutex_unlock(mutex):
 * If OPTIONAL_MUTEX_PTHREAD_YES is defined, call pthread_mutex_unlock();
 * if OPTIONAL_MUTEX_PTHREAD_NO is defined, do nothing.
 */
int optional_mutex_unlock(pthread_mutex_t *);

#endif /* !OPTIONAL_MUTEX_H_ */