mirror of
https://github.com/FelixKratz/SketchyBar
synced 2024-11-26 05:10:20 +00:00
use large qlimit for mach port
This commit is contained in:
parent
c5f9e7a6c4
commit
07323b8141
1 changed files with 16 additions and 2 deletions
18
src/mach.c
18
src/mach.c
|
@ -1,4 +1,5 @@
|
|||
#include "mach.h"
|
||||
#include <mach/mach_port.h>
|
||||
#include <mach/message.h>
|
||||
#include <stdint.h>
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
|
@ -135,6 +136,17 @@ bool mach_server_begin(struct mach_server* mach_server, mach_handler handler) {
|
|||
return false;
|
||||
}
|
||||
|
||||
struct mach_port_limits limits = {};
|
||||
limits.mpl_qlimit = MACH_PORT_QLIMIT_LARGE;
|
||||
|
||||
if (mach_port_set_attributes(mach_server->task,
|
||||
mach_server->port,
|
||||
MACH_PORT_LIMITS_INFO,
|
||||
(mach_port_info_t)&limits,
|
||||
MACH_PORT_LIMITS_INFO_COUNT) != KERN_SUCCESS) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mach_port_insert_right(mach_server->task,
|
||||
mach_server->port,
|
||||
mach_server->port,
|
||||
|
@ -160,8 +172,10 @@ bool mach_server_begin(struct mach_server* mach_server, mach_handler handler) {
|
|||
mach_server->handler = handler;
|
||||
mach_server->is_running = true;
|
||||
|
||||
|
||||
pthread_create(&mach_server->thread, NULL, mach_connection_handler, mach_server);
|
||||
pthread_create(&mach_server->thread,
|
||||
NULL,
|
||||
mach_connection_handler,
|
||||
mach_server );
|
||||
return true;
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
|
|
Loading…
Reference in a new issue