aboutsummaryrefslogtreecommitdiff
path: root/src/include/ipxe/pending.h
blob: 51afb43709c18cbb56432c09bf4b84b796cd1005 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef _IPXE_PENDING_H
#define _IPXE_PENDING_H

/** @file
 *
 * Pending operations
 *
 */

FILE_LICENCE ( GPL2_OR_LATER );

#include <ipxe/list.h>

/** A pending operation */
struct pending_operation {
	/** Pending count */
	unsigned int count;
};

/**
 * Check if an operation is pending
 *
 * @v pending		Pending operation
 * @v is_pending	Operation is pending
 */
static inline int is_pending ( struct pending_operation *pending ) {
	return ( pending->count != 0 );
}

extern void pending_get ( struct pending_operation *pending );
extern void pending_put ( struct pending_operation *pending );
extern int pending_wait ( unsigned long timeout );

#endif /* _IPXE_PENDING_H */