File: lock.c

package info (click to toggle)
multipath-tools 0.14.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,088 kB
  • sloc: ansic: 64,885; perl: 1,622; makefile: 742; sh: 732; pascal: 155
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);
}