Skip to content

Commit

Permalink
Merge pull request #1844 from timblechmann/fixes/for-master
Browse files Browse the repository at this point in the history
Fixes/for master
  • Loading branch information
telephon committed Jan 31, 2016
2 parents 1776e52 + 31aecdf commit c7b8291
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lang/LangSource/PyrObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1186,8 +1186,10 @@ void buildBigMethodMatrix()
double t0 = elapsedTime();
#endif

const int cpuCount = thread::hardware_concurrency();
boost::basic_thread_pool pool( std::min( cpuCount - 1, 1 ) );
const int hw_concurrency = thread::hardware_concurrency();
const int cpuCount = hw_concurrency > 0 ? hw_concurrency : 1;
const int helperThreadCount = cpuCount > 1 ? cpuCount - 1 : 1;
boost::basic_thread_pool pool( helperThreadCount );

// pyrmalloc:
// lifetime: kill after compile
Expand Down
2 changes: 1 addition & 1 deletion server/supernova/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -173,5 +173,5 @@ endif()

if (APPLE)
target_link_libraries(libsupernova "-framework Accelerate")
target_link_libraries(libsupernova "-framework CoreAudio -framework CoreServices -framework Foundation")
target_link_libraries(libsupernova "-framework CoreAudio -framework CoreServices -framework Foundation -framework ApplicationServices")
endif()
12 changes: 12 additions & 0 deletions server/supernova/server/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
#include <sys/resource.h>
#endif

#ifdef __APPLE__
# include <ApplicationServices/ApplicationServices.h>
#endif


#if (_POSIX_MEMLOCK - 0) >= 200112L
# include <sys/resource.h>
# include <sys/mman.h>
Expand Down Expand Up @@ -363,6 +368,13 @@ int main(int argc, char * argv[])
return 0;
}

#ifdef __APPLE__
ProcessSerialNumber psn;
if (GetCurrentProcess(&psn) == noErr) {
TransformProcessType(&psn, kProcessTransformToUIElementApplication);
}
#endif

rt_pool.init(args.rt_pool_size * 1024, args.memory_locking);
lock_memory(args);

Expand Down

0 comments on commit c7b8291

Please sign in to comment.