From e6cc8b86efac6c64d46604baabcd41f5af8c9ff3 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 23 Jun 2015 17:53:58 +0000 Subject: fix #3862 --- src/include/gnunet_common.h | 71 ++++++++++++++++++++++++++++++++++++++ src/include/gnunet_crypto_lib.h | 5 --- src/include/gnunet_scheduler_lib.h | 67 ----------------------------------- 3 files changed, 71 insertions(+), 72 deletions(-) (limited to 'src') diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h index cd75cc3bd..4e882c113 100644 --- a/src/include/gnunet_common.h +++ b/src/include/gnunet_common.h @@ -1133,6 +1133,77 @@ GNUNET_copy_message (const struct GNUNET_MessageHeader *msg); #endif +/** + * Valid task priorities. Use these, do not pass random integers! + * For various reasons (#3862 -- building with QT Creator, and + * our restricted cross-compilation with emscripten) this cannot + * be in gnunet_scheduler_lib.h, but it works if we declare it here. + * Naturally, logically this is part of the scheduler. + */ +enum GNUNET_SCHEDULER_Priority +{ + /** + * Run with the same priority as the current job. + */ + GNUNET_SCHEDULER_PRIORITY_KEEP = 0, + + /** + * Run when otherwise idle. + */ + GNUNET_SCHEDULER_PRIORITY_IDLE = 1, + + /** + * Run as background job (higher than idle, + * lower than default). + */ + GNUNET_SCHEDULER_PRIORITY_BACKGROUND = 2, + + /** + * Run with the default priority (normal + * P2P operations). Any task that is scheduled + * without an explicit priority being specified + * will run with this priority. + */ + GNUNET_SCHEDULER_PRIORITY_DEFAULT = 3, + + /** + * Run with high priority (important requests). + * Higher than DEFAULT. + */ + GNUNET_SCHEDULER_PRIORITY_HIGH = 4, + + /** + * Run with priority for interactive tasks. + * Higher than "HIGH". + */ + GNUNET_SCHEDULER_PRIORITY_UI = 5, + + /** + * Run with priority for urgent tasks. Use + * for things like aborts and shutdowns that + * need to preempt "UI"-level tasks. + * Higher than "UI". + */ + GNUNET_SCHEDULER_PRIORITY_URGENT = 6, + + /** + * This is an internal priority level that is only used for tasks + * that are being triggered due to shutdown (they have automatically + * highest priority). User code must not use this priority level + * directly. Tasks run with this priority level that internally + * schedule other tasks will see their original priority level + * be inherited (unless otherwise specified). + */ + GNUNET_SCHEDULER_PRIORITY_SHUTDOWN = 7, + + /** + * Number of priorities (must be the last priority). + * This priority must not be used by clients. + */ + GNUNET_SCHEDULER_PRIORITY_COUNT = 8 +}; + + #if 0 /* keep Emacsens' auto-indent happy */ { #endif diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h index 93206cfc3..7439932c9 100644 --- a/src/include/gnunet_crypto_lib.h +++ b/src/include/gnunet_crypto_lib.h @@ -56,11 +56,6 @@ struct GNUNET_PeerIdentity; #include "gnunet_common.h" #include -/** - * We need this enum here, but not the entire scheduler API. - * For the full definition, see gnunet_scheduler_lib.h. - */ -enum GNUNET_SCHEDULER_Priority; /** * @brief A 512-bit hashcode diff --git a/src/include/gnunet_scheduler_lib.h b/src/include/gnunet_scheduler_lib.h index 94e13f9b2..7c9ff1553 100644 --- a/src/include/gnunet_scheduler_lib.h +++ b/src/include/gnunet_scheduler_lib.h @@ -87,73 +87,6 @@ enum GNUNET_SCHEDULER_Reason }; -/** - * Valid task priorities. Use these, do not - * pass random integers! - */ -enum GNUNET_SCHEDULER_Priority -{ - /** - * Run with the same priority as the current job. - */ - GNUNET_SCHEDULER_PRIORITY_KEEP = 0, - - /** - * Run when otherwise idle. - */ - GNUNET_SCHEDULER_PRIORITY_IDLE = 1, - - /** - * Run as background job (higher than idle, - * lower than default). - */ - GNUNET_SCHEDULER_PRIORITY_BACKGROUND = 2, - - /** - * Run with the default priority (normal - * P2P operations). Any task that is scheduled - * without an explicit priority being specified - * will run with this priority. - */ - GNUNET_SCHEDULER_PRIORITY_DEFAULT = 3, - - /** - * Run with high priority (important requests). - * Higher than DEFAULT. - */ - GNUNET_SCHEDULER_PRIORITY_HIGH = 4, - - /** - * Run with priority for interactive tasks. - * Higher than "HIGH". - */ - GNUNET_SCHEDULER_PRIORITY_UI = 5, - - /** - * Run with priority for urgent tasks. Use - * for things like aborts and shutdowns that - * need to preempt "UI"-level tasks. - * Higher than "UI". - */ - GNUNET_SCHEDULER_PRIORITY_URGENT = 6, - - /** - * This is an internal priority level that is only used for tasks - * that are being triggered due to shutdown (they have automatically - * highest priority). User code must not use this priority level - * directly. Tasks run with this priority level that internally - * schedule other tasks will see their original priority level - * be inherited (unless otherwise specified). - */ - GNUNET_SCHEDULER_PRIORITY_SHUTDOWN = 7, - - /** - * Number of priorities (must be the last priority). - * This priority must not be used by clients. - */ - GNUNET_SCHEDULER_PRIORITY_COUNT = 8 -}; - #include "gnunet_time_lib.h" #include "gnunet_network_lib.h" -- cgit v1.2.3