[go: up one dir, main page]

File: locking.c

package info (click to toggle)
cmus 2.0.4-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,092 kB
  • ctags: 2,405
  • sloc: ansic: 21,341; sh: 959; makefile: 165
file content (18 lines) | stat: -rw-r--r-- 379 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "locking.h"
#include "debug.h"

#include <string.h>

void cmus_mutex_lock(pthread_mutex_t *mutex)
{
	int rc = pthread_mutex_lock(mutex);
	if (unlikely(rc))
		BUG("error locking mutex: %s\n", strerror(rc));
}

void cmus_mutex_unlock(pthread_mutex_t *mutex)
{
	int rc = pthread_mutex_unlock(mutex);
	if (unlikely(rc))
		BUG("error unlocking mutex: %s\n", strerror(rc));
}