You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pending.h 818B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef _IPXE_PENDING_H
  2. #define _IPXE_PENDING_H
  3. /** @file
  4. *
  5. * Pending operations
  6. *
  7. */
  8. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  9. /** A pending operation */
  10. struct pending_operation {
  11. /** Pending count */
  12. unsigned int count;
  13. };
  14. /**
  15. * Check if an operation is pending
  16. *
  17. * @v pending Pending operation
  18. * @ret is_pending Operation is pending
  19. */
  20. static inline int is_pending ( struct pending_operation *pending ) {
  21. return ( pending->count != 0 );
  22. }
  23. extern int pending_total;
  24. /**
  25. * Check if any operations are pending
  26. *
  27. * @ret have_pending Some operations are pending
  28. */
  29. static inline int have_pending ( void ) {
  30. return ( pending_total != 0 );
  31. }
  32. extern void pending_get ( struct pending_operation *pending );
  33. extern void pending_put ( struct pending_operation *pending );
  34. #endif /* _IPXE_PENDING_H */