@@ -51,6 +51,7 @@ pub enum GlobalQueueIdentifier {
5151
5252impl GlobalQueueIdentifier {
5353 /// Convert and consume [GlobalQueueIdentifier] into its raw value.
54+ #[ inline]
5455 pub fn to_identifier ( self ) -> isize {
5556 match self {
5657 GlobalQueueIdentifier :: Priority ( queue_priority) => queue_priority. 0 as isize ,
@@ -70,13 +71,15 @@ dispatch_object_not_data!(unsafe DispatchQueue);
7071
7172impl DispatchQueue {
7273 /// Create a new [`DispatchQueue`].
74+ #[ inline]
7375 pub fn new ( label : & str , queue_attribute : Option < & DispatchQueueAttr > ) -> DispatchRetained < Self > {
7476 let label = CString :: new ( label) . expect ( "Invalid label!" ) ;
7577
7678 Self :: __new ( Some ( & label) , queue_attribute)
7779 }
7880
7981 /// Create a new [`DispatchQueue`] with a given target [`DispatchQueue`].
82+ #[ inline]
8083 pub fn new_with_target (
8184 label : & str ,
8285 queue_attribute : Option < & DispatchQueueAttr > ,
@@ -89,6 +92,7 @@ impl DispatchQueue {
8992 }
9093
9194 /// Return a system-defined global concurrent [`DispatchQueue`] with the priority derived from [GlobalQueueIdentifier].
95+ #[ inline]
9296 pub fn global_queue ( identifier : GlobalQueueIdentifier ) -> DispatchRetained < Self > {
9397 let raw_identifier = identifier. to_identifier ( ) ;
9498
@@ -109,6 +113,7 @@ impl DispatchQueue {
109113 }
110114
111115 /// Submit a function for synchronous execution on the [`DispatchQueue`].
116+ #[ inline]
112117 pub fn exec_sync < F > ( & self , work : F )
113118 where
114119 F : Send + FnOnce ( ) ,
@@ -124,6 +129,7 @@ impl DispatchQueue {
124129 }
125130
126131 /// Submit a function for asynchronous execution on the [`DispatchQueue`].
132+ #[ inline]
127133 pub fn exec_async < F > ( & self , work : F )
128134 where
129135 // We need `'static` to make sure any referenced values are borrowed for
@@ -137,6 +143,7 @@ impl DispatchQueue {
137143 }
138144
139145 /// Enqueue a function for execution at the specified time on the [`DispatchQueue`].
146+ #[ inline]
140147 pub fn after < F > ( & self , when : DispatchTime , work : F ) -> Result < ( ) , QueueAfterError >
141148 where
142149 F : Send + FnOnce ( ) ,
@@ -150,6 +157,7 @@ impl DispatchQueue {
150157 }
151158
152159 /// Enqueue a barrier function for asynchronous execution on the [`DispatchQueue`] and return immediately.
160+ #[ inline]
153161 pub fn barrier_async < F > ( & self , work : F )
154162 where
155163 // We need `'static` to make sure any referenced values are borrowed for
@@ -163,6 +171,7 @@ impl DispatchQueue {
163171 }
164172
165173 /// Enqueue a barrier function for synchronous execution on the [`DispatchQueue`] and wait until that function completes.
174+ #[ inline]
166175 pub fn barrier_sync < F > ( & self , work : F )
167176 where
168177 F : Send + FnOnce ( ) ,
@@ -174,6 +183,7 @@ impl DispatchQueue {
174183 }
175184
176185 /// Submit a function for synchronous execution and mark the function as a barrier for subsequent concurrent tasks.
186+ #[ inline]
177187 pub fn barrier_async_and_wait < F > ( & self , work : F )
178188 where
179189 // We need `'static` to make sure any referenced values are borrowed for
@@ -187,6 +197,7 @@ impl DispatchQueue {
187197 }
188198
189199 /// Sets a function at the given key that will be executed at [`DispatchQueue`] destruction.
200+ #[ inline]
190201 pub fn set_specific < F > ( & self , key : NonNull < ( ) > , destructor : F )
191202 where
192203 F : Send + FnOnce ( ) ,
@@ -204,6 +215,7 @@ impl DispatchQueue {
204215 }
205216
206217 /// Set the QOS class floor of the [`DispatchQueue`].
218+ #[ inline]
207219 pub fn set_qos_class_floor (
208220 & self ,
209221 qos_class : DispatchQoS ,
@@ -248,13 +260,15 @@ impl DispatchQueueAttr {
248260 // };
249261
250262 /// A dispatch queue that executes blocks concurrently.
263+ #[ inline]
251264 pub fn concurrent ( ) -> Option < & ' static Self > {
252265 // SAFETY: Queues are
253266 unsafe { Some ( & _dispatch_queue_attr_concurrent) }
254267 }
255268}
256269
257270/// Executes blocks submitted to the main queue.
271+ #[ inline]
258272pub fn dispatch_main ( ) -> ! {
259273 extern "C" {
260274 // `dispatch_main` is marked DISPATCH_NOTHROW.
0 commit comments