Commit ab3b6602 authored by Loren Merritt's avatar Loren Merritt

more win32threads -> pthreads


git-svn-id: svn://svn.videolan.org/x264/trunk@610 df754926-b1dd-0310-bc7b-ec298dee348c
parent cc753d6b
......@@ -162,17 +162,15 @@ int x264_cpu_num_processors( void )
#if !defined(HAVE_PTHREAD)
return 1;
#elif defined(SYS_LINUX) || defined(WIN32)
#elif defined(WIN32)
return pthread_num_processors_np();
#elif defined(SYS_LINUX)
unsigned int bit;
int np;
#if defined(WIN32)
uint32_t p_aff, s_aff;
GetProcessAffinityMask( GetCurrentProcess(), &p_aff, &s_aff );
#else
cpu_set_t p_aff;
memset( &p_aff, 0, sizeof(p_aff) );
sched_getaffinity( 0, sizeof(p_aff), &p_aff );
#endif
for( np = 0, bit = 0; bit < sizeof(p_aff); bit++ )
np += (((uint8_t *)&p_aff)[bit / 8] >> (bit % 8)) & 1;
return np;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment