OSDN Git Service

2009-07-27 Emmanuel Briot <briot@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / s-osinte-darwin.adb
index 904e910..ac016d0 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                  B o d y                                 --
 --                                                                          --
---           Copyright (C) 1999-2009 Free Software Foundation, Inc.         --
+--          Copyright (C) 1999-2009, 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- --
@@ -149,6 +149,17 @@ 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 --
    ------------------