iPXE
pending.h
Go to the documentation of this file.
00001 #ifndef _IPXE_PENDING_H
00002 #define _IPXE_PENDING_H
00003 
00004 /** @file
00005  *
00006  * Pending operations
00007  *
00008  */
00009 
00010 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00011 
00012 /** A pending operation */
00013 struct pending_operation {
00014         /** Pending count */
00015         unsigned int count;
00016 };
00017 
00018 /**
00019  * Check if an operation is pending
00020  *
00021  * @v pending           Pending operation
00022  * @ret is_pending      Operation is pending
00023  */
00024 static inline int is_pending ( struct pending_operation *pending ) {
00025         return ( pending->count != 0 );
00026 }
00027 
00028 extern int pending_total;
00029 
00030 /**
00031  * Check if any operations are pending
00032  *
00033  * @ret have_pending    Some operations are pending
00034  */
00035 static inline int have_pending ( void ) {
00036         return ( pending_total != 0 );
00037 }
00038 
00039 extern void pending_get ( struct pending_operation *pending );
00040 extern void pending_put ( struct pending_operation *pending );
00041 
00042 #endif /* _IPXE_PENDING_H */