Revision: 54976
http://brlcad.svn.sourceforge.net/brlcad/?rev=54976&view=rev
Author: brlcad
Date: 2013-03-29 16:57:07 +0000 (Fri, 29 Mar 2013)
Log Message:
-----------
remove the unused/unnecessary variables
Modified Paths:
--------------
brlcad/trunk/src/libbu/affinity.c
Modified: brlcad/trunk/src/libbu/affinity.c
===================================================================
--- brlcad/trunk/src/libbu/affinity.c 2013-03-29 16:54:56 UTC (rev 54975)
+++ brlcad/trunk/src/libbu/affinity.c 2013-03-29 16:57:07 UTC (rev 54976)
@@ -59,25 +59,20 @@
/* Linux and BSD pthread affinity */
- pthread_t curr_thread = pthread_self(); /* Get current thread */
- int ncpu = bu_avail_cpus(); /* Max number of CPUs
available for the process */
- int status; /* Status of thread
setting/getting */
- int cpu = 0; /* Default CPU number */
- int j; /* Variable for iteration. */
-
#ifdef HAVE_CPU_SET_T
cpu_set_t set_of_cpus;
#else
cpuset_t set_of_cpus;
#endif
+ int ret;
/* Clear CPU set and assign our number */
CPU_ZERO(&set_of_cpus);
CPU_SET(bu_parallel_id() & bu_avail_cpus(), &set_of_cpus);
/* set affinity mask of current thread */
- status = pthread_setaffinity_np(curr_thread, sizeof(set_of_cpus),
&set_of_cpus);
- if (status != 0) {
+ ret = pthread_setaffinity_np(pthread_self(), sizeof(set_of_cpus),
&set_of_cpus);
+ if (ret != 0) {
/* Error in setting affinity mask */
return -1;
}
@@ -113,11 +108,13 @@
return 0;
#elif defined(HAVE_WINDOWS_H)
+
BOOL ret = SetThreadAffinityMask(GetCurrentThread(), 1 << bu_parallel_id()
% bu_avail_cpus());
if (ret == 0)
return -1;
return 0;
+
#else
/* don't know how to set thread affinity on this platform */
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Own the Future-Intel(R) Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest. Compete
for recognition, cash, and the chance to get your game on Steam.
$5K grand prize plus 10 genre and skill prizes. Submit your demo
by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits