Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,11 @@ pub fn dispatch_get_main_queue() -> dispatch_queue_t {
&_dispatch_main_q as *const _ as dispatch_queue_t
}

pub fn dispatch_get_attr_concurrent_queue() -> dispatch_queue_attr_t {
&_dispatch_queue_attr_concurrent
}

pub const DISPATCH_QUEUE_SERIAL: dispatch_queue_attr_t = 0 as dispatch_queue_attr_t;
pub static DISPATCH_QUEUE_CONCURRENT: dispatch_queue_attr_t = &_dispatch_queue_attr_concurrent;

pub const DISPATCH_QUEUE_PRIORITY_HIGH: c_long = 2;
pub const DISPATCH_QUEUE_PRIORITY_DEFAULT: c_long = 0;
Expand Down
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ impl QueueAttribute {
fn as_raw(&self) -> dispatch_queue_attr_t {
match *self {
QueueAttribute::Serial => DISPATCH_QUEUE_SERIAL,
QueueAttribute::Concurrent => DISPATCH_QUEUE_CONCURRENT,
QueueAttribute::Concurrent => {
dispatch_get_attr_concurrent_queue()
}
}
}
}
Expand Down