[multiple changes]

2016-04-19  Olivier Hainque  <hainque@adacore.com>

	* par_sco.adb (Traverse_One, case N_Case_Statement):
	Skip pragmas before the first alternative.
	(Traverse_Handled_Statement_Sequence, Exception_Handlers): Likewise.

2016-04-19  Tristan Gingold  <gingold@adacore.com>

	* adaint.c (__gnat_lwp_self): New function (for darwin).
	* s-osinte-darwin.ads, s-osinte-darwin.adb (lwp_self): Import
	of __gnat_lwp_self.

From-SVN: r235204
This commit is contained in:
Arnaud Charlet 2016-04-19 15:24:36 +02:00
parent 65f52ee9b9
commit 009c026845
5 changed files with 474 additions and 424 deletions

View File

@ -1,3 +1,15 @@
2016-04-19 Olivier Hainque <hainque@adacore.com>
* par_sco.adb (Traverse_One, case N_Case_Statement):
Skip pragmas before the first alternative.
(Traverse_Handled_Statement_Sequence, Exception_Handlers): Likewise.
2016-04-19 Tristan Gingold <gingold@adacore.com>
* adaint.c (__gnat_lwp_self): New function (for darwin).
* s-osinte-darwin.ads, s-osinte-darwin.adb (lwp_self): Import
of __gnat_lwp_self.
2016-04-19 Olivier Hainque <hainque@adacore.com>
* sem_util.adb (Build_Elaboration_Entity): Always request an

View File

@ -3101,6 +3101,30 @@ __gnat_lwp_self (void)
}
#endif
#if defined (__APPLE__)
#include <mach/thread_info.h>
#include <mach/mach_init.h>
#include <mach/thread_act.h>
/* System-wide thread identifier. Note it could be truncated on 32 bit
hosts.
Previously was: pthread_mach_thread_np (pthread_self ()). */
void *
__gnat_lwp_self (void)
{
thread_identifier_info_data_t data;
mach_msg_type_number_t count = THREAD_IDENTIFIER_INFO_COUNT;
kern_return_t kret;
kret = thread_info (mach_thread_self (), THREAD_IDENTIFIER_INFO,
(thread_info_t) &data, &count);
if (kret == KERN_SUCCESS)
return (void *)(uintptr_t)data.thread_id;
else
return 0;
}
#endif
#if defined (__linux__)
#include <sched.h>

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1999-2014, Free Software Foundation, Inc. --
-- Copyright (C) 1999-2015, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@ -172,17 +172,6 @@ package body System.OS_Interface is
return 0;
end sched_yield;
--------------
-- lwp_self --
--------------
function lwp_self return Address is
function pthread_mach_thread_np (thread : pthread_t) return Address;
pragma Import (C, pthread_mach_thread_np, "pthread_mach_thread_np");
begin
return pthread_mach_thread_np (pthread_self);
end lwp_self;
------------------
-- pthread_init --
------------------

View File

@ -228,6 +228,7 @@ package System.OS_Interface is
---------
function lwp_self return System.Address;
pragma Import (C, lwp_self, "__gnat_lwp_self");
-- Return the mach thread bound to the current thread. The value is not
-- used by the run-time library but made available to debuggers.