diff options
Diffstat (limited to 'src/include/gnunet_common.h')
-rw-r--r-- | src/include/gnunet_common.h | 71 |
1 files changed, 71 insertions, 0 deletions
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); | |||
1133 | #endif | 1133 | #endif |
1134 | 1134 | ||
1135 | 1135 | ||
1136 | /** | ||
1137 | * Valid task priorities. Use these, do not pass random integers! | ||
1138 | * For various reasons (#3862 -- building with QT Creator, and | ||
1139 | * our restricted cross-compilation with emscripten) this cannot | ||
1140 | * be in gnunet_scheduler_lib.h, but it works if we declare it here. | ||
1141 | * Naturally, logically this is part of the scheduler. | ||
1142 | */ | ||
1143 | enum GNUNET_SCHEDULER_Priority | ||
1144 | { | ||
1145 | /** | ||
1146 | * Run with the same priority as the current job. | ||
1147 | */ | ||
1148 | GNUNET_SCHEDULER_PRIORITY_KEEP = 0, | ||
1149 | |||
1150 | /** | ||
1151 | * Run when otherwise idle. | ||
1152 | */ | ||
1153 | GNUNET_SCHEDULER_PRIORITY_IDLE = 1, | ||
1154 | |||
1155 | /** | ||
1156 | * Run as background job (higher than idle, | ||
1157 | * lower than default). | ||
1158 | */ | ||
1159 | GNUNET_SCHEDULER_PRIORITY_BACKGROUND = 2, | ||
1160 | |||
1161 | /** | ||
1162 | * Run with the default priority (normal | ||
1163 | * P2P operations). Any task that is scheduled | ||
1164 | * without an explicit priority being specified | ||
1165 | * will run with this priority. | ||
1166 | */ | ||
1167 | GNUNET_SCHEDULER_PRIORITY_DEFAULT = 3, | ||
1168 | |||
1169 | /** | ||
1170 | * Run with high priority (important requests). | ||
1171 | * Higher than DEFAULT. | ||
1172 | */ | ||
1173 | GNUNET_SCHEDULER_PRIORITY_HIGH = 4, | ||
1174 | |||
1175 | /** | ||
1176 | * Run with priority for interactive tasks. | ||
1177 | * Higher than "HIGH". | ||
1178 | */ | ||
1179 | GNUNET_SCHEDULER_PRIORITY_UI = 5, | ||
1180 | |||
1181 | /** | ||
1182 | * Run with priority for urgent tasks. Use | ||
1183 | * for things like aborts and shutdowns that | ||
1184 | * need to preempt "UI"-level tasks. | ||
1185 | * Higher than "UI". | ||
1186 | */ | ||
1187 | GNUNET_SCHEDULER_PRIORITY_URGENT = 6, | ||
1188 | |||
1189 | /** | ||
1190 | * This is an internal priority level that is only used for tasks | ||
1191 | * that are being triggered due to shutdown (they have automatically | ||
1192 | * highest priority). User code must not use this priority level | ||
1193 | * directly. Tasks run with this priority level that internally | ||
1194 | * schedule other tasks will see their original priority level | ||
1195 | * be inherited (unless otherwise specified). | ||
1196 | */ | ||
1197 | GNUNET_SCHEDULER_PRIORITY_SHUTDOWN = 7, | ||
1198 | |||
1199 | /** | ||
1200 | * Number of priorities (must be the last priority). | ||
1201 | * This priority must not be used by clients. | ||
1202 | */ | ||
1203 | GNUNET_SCHEDULER_PRIORITY_COUNT = 8 | ||
1204 | }; | ||
1205 | |||
1206 | |||
1136 | #if 0 /* keep Emacsens' auto-indent happy */ | 1207 | #if 0 /* keep Emacsens' auto-indent happy */ |
1137 | { | 1208 | { |
1138 | #endif | 1209 | #endif |