File: lock.c

package info (click to toggle)
multipath-tools 0.13.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,992 kB
  • sloc: ansic: 63,788; perl: 1,622; makefile: 729; sh: 647; pascal: 150
file content (18 lines) | stat: -rw-r--r-- 264 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "lock.h"

void cleanup_lock (void * data)
{
	struct mutex_lock *lock = data;
	wakeup_fn *fn = lock->wakeup;

	unlock__(lock);
	if (fn)
		fn();
}

void set_wakeup_fn(struct mutex_lock *lck, wakeup_fn *fn)
{
	lock(lck);
	lck->wakeup = fn;
	unlock__(lck);
}