| 106 | }; |
| 107 | |
| 108 | struct TaskOptions { |
| 109 | TaskOptions(); |
| 110 | TaskOptions(bool high_priority, bool in_place_if_possible); |
| 111 | |
| 112 | // Executor would execute high-priority tasks in the FIFO order but before |
| 113 | // all pending normal-priority tasks. |
| 114 | // NOTE: We don't guarantee any kind of real-time as there might be tasks still |
| 115 | // in process which are uninterruptible. |
| 116 | // |
| 117 | // Default: false |
| 118 | bool high_priority; |
| 119 | |
| 120 | // If |in_place_if_possible| is true, execution_queue_execute would call |
| 121 | // execute immediately instead of starting a bthread if possible |
| 122 | // |
| 123 | // Note: Running callbacks in place might cause the deadlock issue, you |
| 124 | // should be very careful turning this flag on. |
| 125 | // |
| 126 | // Default: false |
| 127 | bool in_place_if_possible; |
| 128 | }; |
| 129 | |
| 130 | const static TaskOptions TASK_OPTIONS_NORMAL = TaskOptions(false, false); |
| 131 | const static TaskOptions TASK_OPTIONS_URGENT = TaskOptions(true, false); |