Revision: 54892
http://brlcad.svn.sourceforge.net/brlcad/?rev=54892&view=rev
Author: brlcad
Date: 2013-03-27 01:22:48 +0000 (Wed, 27 Mar 2013)
Log Message:
-----------
collapse ispar.c into parallel.c even though we want to prefer smaller files.
ispar was a bad non-descript name to begin with and the two functions it
provides are weak. more importantly, the access a global that we can make
static if we consolidate it to parallel.c
Modified Paths:
--------------
brlcad/trunk/src/libbu/CMakeLists.txt
brlcad/trunk/src/libbu/Makefile.am
brlcad/trunk/src/libbu/globals.c
brlcad/trunk/src/libbu/parallel.c
Modified: brlcad/trunk/src/libbu/CMakeLists.txt
===================================================================
--- brlcad/trunk/src/libbu/CMakeLists.txt 2013-03-26 20:42:08 UTC (rev
54891)
+++ brlcad/trunk/src/libbu/CMakeLists.txt 2013-03-27 01:22:48 UTC (rev
54892)
@@ -48,7 +48,6 @@
htond.c
htonf.c
interrupt.c
- ispar.c
kill.c
lex.c
linebuf.c
Modified: brlcad/trunk/src/libbu/Makefile.am
===================================================================
--- brlcad/trunk/src/libbu/Makefile.am 2013-03-26 20:42:08 UTC (rev 54891)
+++ brlcad/trunk/src/libbu/Makefile.am 2013-03-27 01:22:48 UTC (rev 54892)
@@ -39,7 +39,6 @@
htond.c \
htonf.c \
interrupt.c \
- ispar.c \
kill.c \
lex.c \
linebuf.c \
Modified: brlcad/trunk/src/libbu/globals.c
===================================================================
--- brlcad/trunk/src/libbu/globals.c 2013-03-26 20:42:08 UTC (rev 54891)
+++ brlcad/trunk/src/libbu/globals.c 2013-03-27 01:22:48 UTC (rev 54892)
@@ -69,14 +69,6 @@
const char bu_strdup_message[] = "bu_strdup string";
/**
- * process id of the initiating thread. used to shutdown bu_parallel
- * threads/procs.
- *
- * NOT published in a public header.
- */
-int bu_pid_of_initiating_thread = 0;
-
-/**
* bu_setjmp_valid is global because BU_SETJUMP() *must* be a macro.
* If you replace bu_bomb() with one of your own, you must also
* provide these variables, even if you don't use them.
Modified: brlcad/trunk/src/libbu/parallel.c
===================================================================
--- brlcad/trunk/src/libbu/parallel.c 2013-03-26 20:42:08 UTC (rev 54891)
+++ brlcad/trunk/src/libbu/parallel.c 2013-03-27 01:22:48 UTC (rev 54892)
@@ -173,7 +173,42 @@
int cpu_id;
};
+
+
+/**
+ * process id of the initiating thread. used to shutdown bu_parallel
+ * threads/procs.
+ *
+ * NOT published in a public header.
+ */
+int bu_pid_of_initiating_thread = 0;
+
+
+int
+bu_is_parallel(void)
+{
+ if (bu_pid_of_initiating_thread != 0)
+ return 1;
+ return 0;
+}
+
+
void
+bu_kill_parallel(void)
+{
+ if (bu_pid_of_initiating_thread == 0)
+ return;
+
+ if (bu_pid_of_initiating_thread == bu_process_id())
+ return;
+
+ bu_terminate(bu_pid_of_initiating_thread);
+
+ return;
+}
+
+
+void
bu_nice_set(int newnice)
{
#ifdef HAVE_SETPRIORITY
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Own the Future-Intel® 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://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits