aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/s-taprop-linux.adb
diff options
context:
space:
mode:
authorJose Ruiz <ruiz@adacore.com>2010-10-18 13:54:23 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2010-10-18 15:54:23 +0200
commit0ae44446c2b6cd370e212fd94fcb8c261f3ef231 (patch)
treefd8be92505a77963bb3e3da7c663b98880cdba33 /gcc/ada/s-taprop-linux.adb
parent3fd9f17cdc0903732072cd64349ef14912d9cab0 (diff)
downloadgcc-0ae44446c2b6cd370e212fd94fcb8c261f3ef231.zip
gcc-0ae44446c2b6cd370e212fd94fcb8c261f3ef231.tar.gz
gcc-0ae44446c2b6cd370e212fd94fcb8c261f3ef231.tar.bz2
adaint.c (__gnat_pthread_setaffinity_np, [...]): Remove wrappers, no longer needed.
2010-10-18 Jose Ruiz <ruiz@adacore.com> * adaint.c (__gnat_pthread_setaffinity_np, __gnat_pthread_attr_setaffinity_np): Remove wrappers, no longer needed. * s-osinte-linux.ads (pthread_setaffinity_np, pthread_attr_setaffinity_np): Remove use of wrappers. * s-taprop-linux.adb (Create_Task, Initialize): Restore check to verify whether the affinity functionality is available in the OS. * gcc-interface/utils.c: Set TREE_STATIC on functions only when there are defined. From-SVN: r165635
Diffstat (limited to 'gcc/ada/s-taprop-linux.adb')
-rw-r--r--gcc/ada/s-taprop-linux.adb14
1 files changed, 11 insertions, 3 deletions
diff --git a/gcc/ada/s-taprop-linux.adb b/gcc/ada/s-taprop-linux.adb
index b3554aa..db6ac9f 100644
--- a/gcc/ada/s-taprop-linux.adb
+++ b/gcc/ada/s-taprop-linux.adb
@@ -851,7 +851,14 @@ package body System.Task_Primitives.Operations is
-- not behaving as expected. Setting the required attributes for the
-- creation of the thread works correctly and it is more appropriate.
- if T.Common.Base_CPU /= System.Multiprocessors.Not_A_Specific_CPU then
+ -- Do nothing if required support not provided by the operating system
+
+ if pthread_attr_setaffinity_np'Address = System.Null_Address then
+ null;
+
+ -- Support is available
+
+ elsif T.Common.Base_CPU /= System.Multiprocessors.Not_A_Specific_CPU then
declare
CPU_Set : aliased cpu_set_t := (bits => (others => False));
begin
@@ -1326,8 +1333,9 @@ package body System.Task_Primitives.Operations is
-- pragma CPU for the environment task
- if Environment_Task.Common.Base_CPU /=
- System.Multiprocessors.Not_A_Specific_CPU
+ if pthread_setaffinity_np'Address /= System.Null_Address
+ and then Environment_Task.Common.Base_CPU /=
+ System.Multiprocessors.Not_A_Specific_CPU
then
declare
CPU_Set : aliased cpu_set_t := (bits => (others => False));