diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2016-04-19 15:24:36 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2016-04-19 15:24:36 +0200 |
commit | 009c026845b2e38657c54c21a32985fab828b76c (patch) | |
tree | f49c9951a6849bfcc1afac5742335bbac380f508 /gcc/ada/adaint.c | |
parent | 65f52ee9b978858ed791162f29a04f2cbcef6dbc (diff) | |
download | gcc-009c026845b2e38657c54c21a32985fab828b76c.zip gcc-009c026845b2e38657c54c21a32985fab828b76c.tar.gz gcc-009c026845b2e38657c54c21a32985fab828b76c.tar.bz2 |
[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
Diffstat (limited to 'gcc/ada/adaint.c')
-rw-r--r-- | gcc/ada/adaint.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c index a9a5b68..2c47f00 100644 --- a/gcc/ada/adaint.c +++ b/gcc/ada/adaint.c @@ -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> |