2
0
mirror of https://github.com/xcat2/xNBA.git synced 2026-04-01 02:53:28 +00:00
Files
xNBA/src/include/ipxe/pending.h
Michael Brown 021d7b21b7 [pending] Add concept of "pending operations"
iPXE is fundamentally asynchronous in operation: some operations
continue in the background even after the foreground has continued to
a new task.  For example, the closing FIN/ACK exchanges of a TCP
connection will take place in the background after an HTTP download
has completed.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-06-09 18:48:28 +01:00

35 lines
680 B
C

#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 */