Files
MapLibreParticleLab/platform/darwin/src/nsthread.mm
2016-07-16 10:38:42 +03:00

27 lines
470 B
Plaintext

#import <Foundation/Foundation.h>
#include <mbgl/platform/platform.hpp>
#include <pthread.h>
namespace mbgl {
namespace platform {
std::string getCurrentThreadName() {
char name[32] = "unknown";
pthread_getname_np(pthread_self(), name, sizeof(name));
return name;
}
void setCurrentThreadName(const std::string& name) {
pthread_setname_np(name.c_str());
}
void makeThreadLowPriority() {
[[NSThread currentThread] setThreadPriority:0.0];
}
}
}